To complete and rectify the picture:
OSWidget withCrLf: and withLf: are private methods, thus internal to CommonWidgets and are not of general use and initially they were NOT UnicodeString aware.
They cover an ancient bug in certain modal Windows messages with icons with a text where the text was not shown properly, causing their display to be strange because of the termination of the message string, once considered to be a Windows bug.
The purpose was to keep message senders platform independent (look similar undex X-Motif, AIX and Windows).
Hence my recommendation is enforced: do not explicitely apply these two methods.
However, in case that they are implicitly applied, eg. when using an official API with UnicodeStrings and then causing a crash, CommonWidgets have to be fixed (again) to deal with those modal Windows message boxes so that the initial bugs are kept to be covered and fixed.
I do not know if the two methods now are know considered to be UnicodeString aware or not.
The problem is a consistent handling of line termination. It is older than 30 years.
Under Windows two characters, CR and LF are in use, this pair was considered to be written explicitely (0D0A).
Under Unix, by convention, only LF aka \n was used to terminate lines (the cr was implied by printers and terminals).
Under Unicode this got a twist, as there is a single Grapheme crlf (=size 1, capacity=2) serving this purpose.
In Smalltalk under Windows the Unix style and habit was supported, e.g. as in Transcript cr and the like. The mandatory second character was provided implicitely, that followed somehow the Unix world, though running under Windows. This led to the special Linefeed constructs e.g. in CommonFile.
Smalltalk is stressed here because of its initially implied platform independency, given some Windows inconsistency, and now under the apsect of relatevily new Unicode graphemes.
-
M