Nicolas Cellier uploaded a new version of Multilingual to project The Inbox:
http://source.squeak.org/inbox/Multilingual-nice.249.mcz ==================== Summary ==================== Name: Multilingual-nice.249 Author: nice Time: 9 December 2019, 6:17:46.99458 pm UUID: 1a02af2f-d014-2a4e-9023-ef0cec93897b Ancestors: Multilingual-nice.248 1) Nuke code specific to windows CE OS. We do not support such legacy OS in Opensmalltalk VM. Multilingual is complex enough without this useless drag. 2) Fix LanguageEnvironment comment which was a mixture of iso8859L1 (ByteString) and UTF32 (WideString) re-interpreted as ByteString. Note: that might have happened before UTF8 fixes to Monticello (the stream did start as ByteString, but did continue as WideString at first non-byte code... The encoding change did only happen at buffer boundary leading to such strange side-effects). Fortunately (sic!) most Multilingual classes are un-commented. 3) Nuke useless copy of 'encoding' literal 4) Comment possibly incorrect usage of (evtBuf at: 3) in UTF32InputInterpreter. This is the charCode field of squeak event, which is not anymore macRoman encoded on recent windows VM. More work is required at VM side for Unix before we can fully clean-up... 5) classify UTF32RussianInputInterpreter in same category than siblings =============== Diff against Multilingual-nice.248 =============== Item was changed: ----- Method: JapaneseEnvironment class>>clipboardInterpreterClass (in category 'subclass responsibilities') ----- clipboardInterpreterClass | platformName osVersion | platformName := Smalltalk platformName. osVersion := Smalltalk osVersion. - (platformName = 'Win32' and: [osVersion = 'CE']) - ifTrue: [^NoConversionClipboardInterpreter]. platformName = 'Win32' ifTrue: [^UTF8ClipboardInterpreter]. platformName = 'Mac OS' ifTrue: [^MacShiftJISClipboardInterpreter]. ^platformName = 'unix' ifTrue: [(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding) ifTrue: [MacShiftJISClipboardInterpreter] ifFalse: [UnixJPClipboardInterpreter]] ifFalse: [ NoConversionClipboardInterpreter ]! Item was changed: ----- Method: JapaneseEnvironment class>>defaultEncodingName (in category 'public query') ----- defaultEncodingName | platformName osVersion | platformName := Smalltalk platformName. osVersion := Smalltalk osVersion. - (platformName = 'Win32' and: [osVersion = 'CE']) ifTrue: [^'utf-8']. (#('Win32' 'ZaurusOS') includes: platformName) ifTrue: [^'shift-jis']. platformName = 'Mac OS' ifTrue: [^('10*' match: osVersion) ifTrue: ['utf-8'] ifFalse: ['shift-jis']]. ^'unix' = platformName ifTrue: ['euc-jp'] ifFalse: ['mac-roman']! Item was changed: ----- Method: JapaneseEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') ----- inputInterpreterClass | platformName osVersion encoding | platformName := Smalltalk platformName. osVersion := Smalltalk osVersion. - (platformName = 'Win32' - and: [osVersion = 'CE']) - ifTrue: [^ MacRomanInputInterpreter]. platformName = 'Win32' ifTrue: [^ (self win32VMUsesUnicode) ifTrue: [UTF32JPInputInterpreter] ifFalse: [WinShiftJISInputInterpreter]]. platformName = 'Mac OS' ifTrue: [^ (('10*' match: osVersion) and: [(Smalltalk getSystemAttribute: 3) isNil]) ifTrue: [MacUnicodeInputInterpreter] ifFalse: [MacShiftJISInputInterpreter]]. platformName = 'unix' ifTrue: [encoding := X11Encoding encoding. (EUCJPTextConverter encodingNames includes: encoding) ifTrue: [^ UnixEUCJPInputInterpreter]. (UTF8TextConverter encodingNames includes: encoding) ifTrue: [^ UnixUTF8JPInputInterpreter]. (ShiftJISTextConverter encodingNames includes: encoding) ifTrue: [^ MacShiftJISInputInterpreter]]. ^ MacRomanInputInterpreter! Item was changed: ----- Method: KoreanEnvironment class>>clipboardInterpreterClass (in category 'subclass responsibilities') ----- clipboardInterpreterClass | platformName osVersion | platformName := Smalltalk platformName. osVersion := Smalltalk osVersion. - (platformName = 'Win32' and: [osVersion = 'CE']) - ifTrue: [^NoConversionClipboardInterpreter]. platformName = 'Win32' ifTrue: [^WinKSX1001ClipboardInterpreter]. platformName = 'Mac OS' ifTrue: [('10*' match: osVersion) ifTrue: [^NoConversionClipboardInterpreter] ifFalse: [^WinKSX1001ClipboardInterpreter]]. platformName = 'unix' ifTrue: [(ShiftJISTextConverter encodingNames includes: X11Encoding getEncoding) ifTrue: [^WinKSX1001ClipboardInterpreter] ifFalse: [^NoConversionClipboardInterpreter]]. ^NoConversionClipboardInterpreter! Item was changed: ----- Method: KoreanEnvironment class>>defaultEncodingName (in category 'public query') ----- defaultEncodingName | platformName osVersion | platformName := Smalltalk platformName. osVersion := Smalltalk osVersion. - (platformName = 'Win32' and: [osVersion = 'CE']) ifTrue: [^'utf-8' copy]. (#('Win32' 'Mac OS' 'ZaurusOS') includes: platformName) + ifTrue: [^'euc-kr']. + (#('unix') includes: platformName) ifTrue: [^'euc-kr']. - ifTrue: [^'euc-kr' copy]. - (#('unix') includes: platformName) ifTrue: [^'euc-kr' copy]. ^'mac-roman'! Item was changed: ----- Method: KoreanEnvironment class>>inputInterpreterClass (in category 'subclass responsibilities') ----- inputInterpreterClass | platformName osVersion encoding | platformName := Smalltalk platformName. osVersion := Smalltalk osVersion. - (platformName = 'Win32' and: [osVersion = 'CE']) - ifTrue: [^MacRomanInputInterpreter]. platformName = 'Win32' ifTrue: [^WinKSX1001InputInterpreter]. platformName = 'Mac OS' ifTrue: [('10*' match: osVersion) ifTrue: [^MacUnicodeInputInterpreter] ifFalse: [^WinKSX1001InputInterpreter]]. platformName = 'unix' ifTrue: [encoding := X11Encoding encoding. (EUCJPTextConverter encodingNames includes: encoding) ifTrue: [^MacRomanInputInterpreter]. (UTF8TextConverter encodingNames includes: encoding) ifTrue: [^MacRomanInputInterpreter]. (ShiftJISTextConverter encodingNames includes: encoding) ifTrue: [^MacRomanInputInterpreter]]. ^MacRomanInputInterpreter! Item was changed: Object subclass: #LanguageEnvironment instanceVariableNames: 'id' classVariableNames: 'ClipboardInterpreterClass FileNameConverterClass InputInterpreterClass KnownEnvironments SystemConverterClass' poolDictionaries: '' category: 'Multilingual-Languages'! + !LanguageEnvironment commentStamp: 'nice 12/9/2019 15:34' prior: 0! - !LanguageEnvironment commentStamp: 'bf 8/16/2009 16:52' prior: 0! The name multilingualized Squeak suggests that you can use multiple language at one time. This is true, of course, but the system still how to manage the primary language; that provides the interpretation of data going out or coming in from outside world. It also provides how to render strings, as there rendering rule could be different in one language to another, even if the code points in a string is the same. Originally, LanguageEnvironment and its subclasses only has class side methods. After merged with Diego's Babel work, it now has instance side methods. Since this historical reason, the class side and instance side are not related well. + When we talk about the interface with the outside of the Squeak world, there are three different "channels"; the keyboard input, clipboard output and input, and filename. On a not-to-uncommon system such as a Unix system localized to Japan, all of these three can have (and does have) different encodings. So we need to manage them separately. Note that the encoding in a file can be anything. While it is nice to provide a suggested guess for this 'default system file content encoding', it is not critical. + + Rendering support is limited basic L-to-R rendering so far. But you can provide different line-wrap rule, at least. + ! - When we talk about the interface with the ou t s i d e o f t h e S q u e a k w o r l d , t h e r e a r e t h r e e d i f f e r e n t " |