Encodings supported by Java?
- From: Casper <casper@xxxxxx>
- Date: Wed, 29 Jun 2005 10:48:47 +0200
National codepage ASCII extensions are suppose to be supported by the "java.io" and the "java.lang" packages contained in charsets.jar. Oddly enough, the "java.nio" which holds the nationalization Charset class, does not seem to know any of these specific codepages:
Charset.isSupported("Cp850"); // the outcome is false.According to http://www.rgagnon.com/javadetails/encoding.html, a suite of language specific locales are supported (incl. Cp850). And oddly enough, I can actually use the Cp850 encoding in the "java.io" API without a problem:
....new InputStreamReader(BufferedInputStream(new FileInputStream("a.txt")), "Cp850");
It seems confusing and messy if charsets are not all encapsulated by the same object (Charset). Does this mean I have no way of testing whether a charset is supported, except through some really crude trial-n-error mis-use of an InputStream?
How should I go about encapsulating charset support for my application, if only some are contained within Charset and the rest are hidden away somewhere as string identifiers in the "java.io" package?
Regards, Casper .
- Follow-Ups:
- Re: Encodings supported by Java?
- From: Casper
- Re: Encodings supported by Java?
- Prev by Date: Re: j2ee training course
- Next by Date: Re: Encodings supported by Java?
- Previous by thread: j2ee training course
- Next by thread: Re: Encodings supported by Java?
- Index(es):
Relevant Pages
|
|