[Haskell-cafe] Re: String vs ByteString

wren ng thornton wren at freegeek.org
Tue Aug 17 21:43:51 EDT 2010

Michael Snoyman wrote:
> On Tue, Aug 17, 2010 at 2:20 PM, Ivan Lazar Miljenovic <
> ivan.miljenovic at gmail.com> wrote:
>> Michael Snoyman <michael at snoyman.com> writes:
>>> I don't think *anyone* is asserting that UTF-16 is a common encoding
>>> for files anywhere,
>> *ahem*
>> http://en.wikipedia.org/wiki/UTF-16/UCS-2#Use_in_major_operating_systems_and_environments
>> I was talking about the contents of the files, not the file names or how
> the system calls work. I know at least on Windows, Linux and FreeBSD, if you
> open up the default text editor, type in a few letters and hit save, the
> file will not be in UTF-16.

OSX, TextEdit, plain text mode is UTF-16 and cannot be altered. Also, if 
you load a UTF-8 plain text file in TextEdit it will be garbled because 
it assumes UTF-16. For html files you can choose the encoding, which 
defaults to UTF-8. But for plain text, it's always UTF-16. OSX is also 
fond of UTF-16 in Cocoa...

Live well,

More information about the Haskell-Cafe mailing list