Return type / contents for UnicodeString >> #printString has changed
When a UnicodeString executes the method printString. It no longer consistently returns a String with the utf8 bytes of the UnicodeString - but either a String with code points in the active code page, or a UnicodeString if no such reduction is possible.
Reason for change
On Windows, in order to deterministically display Strings/UnicodeStrings in Editors / Inspectors correctly, UnicodeString >> #printElementsOn:recursionSet: had to change. It now puts itself, rather than its utf8 contents to the stream..
This means the result/contents change when a UnicodeString executes the method printString.
Action required
If previously, printString was used to obtain the utf8 bytes of a UnicodeString, it should be replaced by the expression aString utf8 contents.
If previously, printString was used to ensure receiver is an EsString, #asSBString is the best replacement Please note, this will return nil if the string cannot be represented in the active code page..
Last modified date: 02/28/2024