The Trunk: Multilingual-mt.293.mcz

[email protected] Sat, 27 Jun 2026 09:04:29 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
Marcel Taeumel uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-mt.293.mcz

==================== Summary ====================

Name: Multilingual-mt.293
Author: mt
Time: 27 June 2026, 11:04:29.246337 am
UUID: 2da6aab1-96f8-4740-a64b-1432c795b4e3
Ancestors: Multilingual-mt.292

Revert platform-specific conversion of stdout and stderr to UCS-2/UTF-16LE. It's UTF-8 for cross-platform again.

We fixed the issue in OSVM for Windows and will use that fixed version for the upcoming Squeak 6.1 release.

See: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7b583d852d83f3c513fd9c45646a6c69abceb57c

=============== Diff against Multilingual-mt.292 ===============

Item was changed:
  StandardFileStream subclass: #MultiByteFileStream
  	instanceVariableNames: 'converter lineEndConvention wantsLineEndConversion'
+ 	classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings LookAheadCount'
- 	classVariableNames: 'Cr CrLf Lf LineEndDefault LineEndStrings LookAheadCount UseUTF16ForStderr UseUTF16ForStdout'
  	poolDictionaries: ''
  	category: 'Multilingual-TextConversion'!
  
  !MultiByteFileStream commentStamp: '<historical>' prior: 0!
  The central class to access the external file.  The interface of this object is similar to good old StandardFileStream, but internally it asks the converter, which is a sub-instance of TextConverter, and do the text conversion.
  
    It also combined the good old CrLfFileStream.  CrLfFileStream class>>new now returns an instance of MultiByteFileStream.
  
    There are several pitfalls:
  
    * You always have to be careful about the binary/text distinction.  In #text mode, it usually interpret the bytes.
    * A few file pointer operations treat the file as uninterpreted byte no matter what.  This means that if you use 'fileStream skip: -1', 'fileStream position: x', etc. in #text mode, the file position can be in the middle of multi byte character.  If you want to implement some function similar to #peek for example, call the saveStateOf: and restoreStateOf: methods to be able to get back to the original state.
    * #lineEndConvention: and #wantsLineEndConversion: (and #binary) can cause some puzzling situation because the inst var lineEndConvention and wantsLineEndConversion are mutated.  If you have any suggestions to clean up the protocol, please let me know.!

Item was removed:
- ----- Method: MultiByteFileStream class>>newForStdio: (in category 'stdio') -----
- newForStdio: moniker
- 	"Use crlf as line end convention on windows, lf on all other platforms. Also make sure that the converter is initialized."
- 	
- 	| lineEndConvention |
- 	lineEndConvention := self lineEndDefault.
- 	lineEndConvention == #crlf ifFalse: [
- 		lineEndConvention := #lf ].
- 	^self new
- 		lineEndConvention: lineEndConvention;
- 		initializeConverterForStdio: moniker;
- 		yourself!

Item was removed:
- ----- Method: MultiByteFileStream class>>useUTF16ForStderr (in category 'stdio') -----
- useUTF16ForStderr
- 	<preference: 'Encode the contents of stderr file with UCS-2/UTF-16 (little endian).'
- 		category: 'Files'
- 		description: 'If true, then the contents of stderr will use UTF-16 text conversion instead of the system language default. This is useful for Windows platforms, where the console expect UTF-16 for Unicode output.'
- 		type: #Boolean>
- 	^ UseUTF16ForStderr ifNil: [ Smalltalk platformName = 'Win32' ]!

Item was removed:
- ----- Method: MultiByteFileStream class>>useUTF16ForStderr: (in category 'stdio') -----
- useUTF16ForStderr: booleanOrNil
- 
- 	UseUTF16ForStderr := booleanOrNil.
- 	self flushAndVoidStdioFiles.!

Item was removed:
- ----- Method: MultiByteFileStream class>>useUTF16ForStdout (in category 'stdio') -----
- useUTF16ForStdout
- 	<preference: 'Encode the contents of stdout file with UCS-2/UTF-16 (little endian).'
- 		category: 'Files'
- 		description: 'If true, then the contents of stdout will use UTF-16 text conversion instead of the system language default. This is useful for Windows platforms, where the console expect UTF-16 for Unicode output.'
- 		type: #Boolean>
- 	^ UseUTF16ForStdout ifNil: [ Smalltalk platformName = 'Win32' ]!

Item was removed:
- ----- Method: MultiByteFileStream class>>useUTF16ForStdout: (in category 'stdio') -----
- useUTF16ForStdout: booleanOrNil
- 
- 	UseUTF16ForStdout := booleanOrNil.
- 	self flushAndVoidStdioFiles.!

Item was removed:
- ----- Method: MultiByteFileStream>>initializeConverterForStdio: (in category 'initialize-release') -----
- initializeConverterForStdio: moniker
- 	"Specialized version of #initializeConverter for stdio use, which allows for overriding the system default according to preferences. For example, Windows may expect UCS-2/UTF-16 for console output."
- 	
- 	self converter: (moniker caseOf: {
- 		[#stdin] -> [Locale currentPlatform newSystemConverter].
- 		[#stdout] -> [
- 			self class useUTF16ForStdout
- 				ifTrue: [UTF16TextConverter new useLittleEndian: true; yourself]
- 				ifFalse: [Locale currentPlatform newSystemConverter]].
- 		[#stderr] -> [
- 			self class useUTF16ForStderr
- 				ifTrue: [UTF16TextConverter new useLittleEndian: true; yourself]
- 				ifFalse: [Locale currentPlatform newSystemConverter]] }).!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]