Closed dram closed 2 years ago
Seems that even unicode characters in comment is not accepted, e.g.:
test
"测试"
After some more investigation, I found that code written to .changes file is correctly encoded, so the problem is related to reading code back from .changes file.
For a quick test, I add theFile converter: UTF8TextConverter new
before nextChunkText
call in RemoteString>>text
, the error does not occur anymore. Of course, there must be some other place which is better to do converter initialization.
The root cause of this issue: although converter
of SourceFiles
is correctly configured, but CurrentReadOnlySourceFiles
is initialized based on SourceFiles
using StandardFileStream>>readOnlyCopy
, which does not copy converter
configuration.
I think one way to fix this problem is to override readOnlyCopy
in MultiByteFileStream
, e.g.:
readOnlyCopy
|copy|
copy := super readOnlyCopy.
converter ifNotNil: [copy converter: converter].
^ copy.
Submit a patch to The Inbox http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-May/220228.html
Merged. Thanks!!
In Squeak 6.0 alpha, when I try to include Unicode characters in method name, following "Note" message will be popped up, and the name is disrupted after save.