Here's a complement to what I wanted to say:
the only thing they didn't provide is a mechanism to know _before_
reading the file what encoding it use.
To say that using different words:
how do you know - without reading it - that this .txt file is an ASCII
file holder or have some encoding and if so which encoding ?
The people who implements the Encodings (UTF8 and so) provides nothing
in term of file storage, file properties - yet -.
This complement my previous answer.
And, Sven is - certainly - correct on its message (read below); however,
if you load the text file without specifying an encoding, you get the
BOM in the text...
The only correct solution I found is to have - like TextEdit - an
Encodings Popup Menu in both Open... and Save As... dialogs. This is not
the case, yet.
A work-around is to provide a MenuItem who lets you convert (load the
text file with a different encodings) the already loaded text file; the
user will be able to get the correct encoding after ome tries...
Emile
[EMAIL PROTECTED] wrote:
Subject: Re: TextOutputStream and encodings
From: Sven E Olsson <[EMAIL PROTECTED]>
Date: Wed, 3 May 2006 20:27:06 +0200
On May 3, 2006, at 2:40 PM, Emile Schwarz wrote:
Thank you, Emile.
That explain the fact that an encoding is not specified in a text =20
file (obvious, but was somehow a mystery).=
In fact, this is a shame.
They made a fantastic job with encodings and failed miserably with
the text files...
One have to know what kind of encoding is used for the text in the
file to been able to read it correctly !
Cheers,
Emile
Hi,
This is not 100% (only 69.4%) true.
1 - As Joe written in the first answer UTF-8 and UTF-16 files could
have/use an BOM.
2 - Other text files like html, xml and like that SHOULD HAVE an
charset declaration.
3 - And then we have some others plain text files, encoded like
MacRoman, MacCyrillic or some others. And here we get some problems.
Just an note.
Regards from Suede
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>