On 20.10.2009, at 09:19, tracker@squeakland.org wrote:
[ http://tracker.immuexa.com/browse/SQ-528 ]
Masashi Umezawa updated SQ-528:
Attachment: JapaneseInputAndClipboardFixForMacVM4-mu.4.cs
Probably you need to restart image after installing this patch. Japanese developers, please test it.
Great, thank you Masashi! Pushed as 2335JapaneseMacVM4-mu (had to shorten the name a bit).
One question:
You replaced "utf8ToSqueak" with "convertFromEncoding: #utf8". These two are supposed to do the same, one is just optimized. What was the problem here?
- Bert -
Hi, Bert
You replaced "utf8ToSqueak" with "convertFromEncoding: #utf8". These two are supposed to do the same, one is just optimized. What was the problem here?
Because the optimized version (ByteString>>utf8ToSqueak) generates a string that does not have "leadingChar" offset, it causes a problem when we copy & paste a multi-byte clipboard text in Squeak. (When copying, string was Japanese string, but in paste, it becomes a raw multibyte-string that does not have leadingChar offset).
For example: data := #(227 129 130 227 129 132 227 129 134 227 129 136 227 129 138) asByteArray "aiueo in Japanese". data asString utf8ToSqueak = (data asString convertFromEncoding: #utf8). "false..."
There would be a better solution in this part, but I was in a hurry anyway.
Cheers,
etoys-dev@lists.squeakfoundation.org