[squeak-dev] Some Win32 ClipboardInterpreter still use squeakToMac, why???

Tobias Pape Das.Linux at gmx.de
Tue Jun 11 17:06:58 UTC 2019


> On 11.06.2019, at 18:22, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
> 
> It seems to me that Clipboard primitives explicitely use UTF8 encoding on Win32 platforms.
> 
> See for example https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/aed5e3391301011cc6b9ee6a353ee563f4ab6dbd/platforms/win32/vm/sqWin32Window.c
> 
> /* Convert data to Unicode UTF16. */
> MultiByteToWideChar( CP_UTF8, 0, cvt, -1, out, wcharsNeeded );
> 
> /* Send the Unicode text to the clipboard. */
> EmptyClipboard();
> SetClipboardData(CF_UNICODETEXT, h);
> 
> and:
> 
> /* Get clipboard data in Unicode format */
> h = GetClipboardData(CF_UNICODETEXT);
> src = GlobalLock(h);
> 
> /* How many bytes do we need to store the UTF8 representation? */
> bytesNeeded = WideCharToMultiByte(CP_UTF8, 0, src, -1,
> NULL, 0, NULL, NULL );
> 
> /* Convert Unicode text to UTF8. */
> cvt = tmp = malloc(bytesNeeded);
> WideCharToMultiByte(CP_UTF8, 0, src, -1, tmp, bytesNeeded, NULL, NULL);
> 
> So it seems to me that:
> 1) all the squeakToMac sends found in various ClipboardInterpreter subclasses (the Win32 ones at least) are completely obsolete
> 2) all the exotic ClipboardInterpreter subclasse, but UTF8ClipboardInterpreter, are themselves obsolete and could be simply withdrawn from service
> 
> Did I miss something, or can I use the high pressure cleaner in this area?
> 

Powerwash all the things!
Let's have UTF-8 for everything external (well, except CJK-locales object, but there we have the leading-char thing anyway, right?)
	-t



More information about the Squeak-dev mailing list