squeak-smalltalk / squeak-object-memory

Issues and assets related to the Squeak object memory.
https://bugs.squeak.org
MIT License
12 stars 1 forks source link

Squeak 6.0 alpha failed to paste unicode text from clipboard under Windows 10 Chinese Edition #9

Closed dram closed 2 years ago

dram commented 2 years ago

When trying to paste unicode text (e.g. 测试) from clipboard data into squeak 6.0 alpha under Windows 10 Chinese Edition, following error occurred:

image

Version: Squeak6.0alpha-21659-64bit-202204190959-Windows-x64

There is no problem in Squeak5.3-19459-64bit-202003021730-Windows

dram commented 2 years ago

After some investigation, I found that ClipboardInterpreter is different between 5.3 and 6.0alpha, i.e.:

LanguageEnvironment defaultClipboardInterpreter => an UTF8ClipboardInterpreter (5.3)
Locale currentPlatform clipboardInterpreter => a WinGB2312ClipboardInterpreter (6.0alpha)
dram commented 2 years ago

After changing to UTF8ClipboardInterpreter for Win32 in SimplifiedChineseEnvironment class>>clipboardInterpreterClass and running following cleanups, copy and paste work without error:

Clipboard clearInterpreters.
LanguageEnvironment resetKnownEnvironments.
dram commented 2 years ago

Submit a patch to The Inbox: https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-May/220227.html

marceltaeumel commented 2 years ago

Merged.

Do you think it makes to add a check for win32VMUsesUnicode? I think we can safely assume that all OSVMs for Squeak 6.0 should support Unicode...

dram commented 2 years ago

Have a read about code of win32VMUsesUnicode, seems that it have been enabled for more than one decade, i.e. 5 June 2007. I also don't think it's necessary to do that check for Squeak 6.0. 😀