[squeak-dev] Survey | Default encoding for new (multi-byte) file streams
ron at usmedrec.com
Mon Apr 11 23:24:25 UTC 2022
On Mon, Apr 11, 2022 at 8:42 AM Marcel Taeumel <marcel.taeumel at hpi.de>
> Hi all --
> What do you think should be the default encoding when opening a new file?
> FileStream readOnlyFileNamed: 'foo' do: [:stream | stream contents].
> They are system/platform-specific for now, but effectively utf-8 on many
> (if not most?) platforms. The original idea seemed to be that platform
> files could be opened without hassle. By now, everybody expects utf-8,
> especially when preparing files for the Web or other external,
> os-independent storage. However, there are platforms (and maybe even
> working VM versions) where this may not be true.
> See Latin1Environment class >> #systemConverterClass to get an idea about
> what can be special about a platform's converter.
> Note that you can always make it explicit:
> FileStream readOnlyFileNamed: 'foo' do: [:stream |
> stream converter: UTF8TextConverter new.
> stream contents].
> (This is not about Squeak's code files .st .cs .changes .source, which are
> utf-8 by default already.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev