New SqueakMap
Yoshiki Ohshima
yoshiki at squeakland.org
Wed Apr 12 21:34:18 UTC 2006
Martin,
> That FileStream oldFileNamed: 'xyz.gif' assumes that xyz.gif is a text
> file of UFT-8 format looks to me like the principle of the biggest
> surprise ;)
Opening a .gif file as a text file with *any* encoding (including
non-conversion latin1) is logically wrong anyway... So this example
may not tell us anything^^;
> I think you can't help the programmer who doesn't know crlf and text
> format problems with this rigid default much, because UTF-8 is a
> relatively uncommon text format and there are many other file operations
> than writing out strings and reading them back. Very soon and in any
> case the novice will find out that something strange is going on there...
Whether it is rigid or not depends on the point of view, IMO... It
can be said that it is forgiving.
I might agree that it is uncommon^^;, but not all the time.
I agree that the programmer needs to take care of it, but reading
any non-text file in text mode creates all sort of problems. One
could say that setting UTF-8 as default helps to find out the bug (or
"something strange") soon.
I'm not too sticky about it and am willing to agree to change the
default conversion (it'll hide many potential bugs, which many of you
seem to want), fixing file list, etc. Just want to hear a bit more
convincing reasons...
-- Yoshiki
More information about the Squeak-dev
mailing list
|