Re: "Platform default encoding"
On Feb 28, 1:01 pm, t...@panix.com (Tim McDaniel) wrote:
I'm not sure which comp.lang.java.* newsgroup is appropriate.
javac documentation at (inter alia)http://download.oracle.com/javase/6/do=
cs/technotes/tools/windows/java...
javac [ options ] [ sourcefiles ] [ classes ] [ @argfiles ]
...
-encoding encoding
Set the source file encoding name, such as EUC-JP and
UTF-8. If -encoding is not specified, the platform defaul=
t
converter is used.
This is frustrating, because
- it doesn't say what the valid choices are.
- it doesn't tell how to actually *determine* the "platform default
converter"! There might be a way to invoke Sun's [sic] javac on su=
ch a
machine to find out, but even better, I'd like to have a URL to a
page provided by Sun (or whoever) listing them.
Your platform documentation will tell you what encoding it uses. No
way Oracle can know that for you.
As for legal encodings, those are universal:
http://ietf.org/rfc/rfc2278.txt
You can find those by reading the Javadocs pertaining to encoding,
e.g.,
http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html
(This class is linked from java.lang.String and
java.io.InputStreamReader)
Note that the Javadocs there list:
Charset Description
US-ASCII Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin bloc=
k of the Unicode character set
ISO-8859-1 ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1
UTF-8 Eight-bit UCS Transformation Format
UTF-16BE Sixteen-bit UCS Transformation Format, big-endian byte order
UTF-16LE Sixteen-bit UCS Transformation Format, little-endian byte orde=
r
UTF-16 Sixteen-bit UCS Transformation Format, byte order identified b=
y an optional byte-order mark
Or who knows? You might even consider reading the occasional
tutorial!
http://download.oracle.com/javase/tutorial/index.html
which features
http://download.oracle.com/javase/tutorial/i18n/text/string.html
So the answer is: Read the documentation, and remember -
GIYF!
--
Lew