Proper use of CharsetDecoder?  
Author Message
pifpafpuf





PostPosted: 2003-8-5 1:13:00 Top

java-programmer, Proper use of CharsetDecoder? I have some text originating from XML which does not
contain tags anymore but character references like "@" .

I thought about writing my own java.nio.charset.CharsetDecoder only
to find that this more or less forces me to also supply a my
own java.nio.charset.Charset class ... and probably a CharsetProvider ...

Since all I want is the conversion of "&64;" and the like
to a Java char I don't see the point of defining a Charset. The
CharsetDecoder alone would suit me well passed right into
a new InputStreamReader(InputStream, CharsetDecoder).

Certainly I misunderstand the importance of the connection between
CharsetDecoder and Charset and should choose a different route.

Should I implement my own Reader having the converions built in? This seems
equally odd.

Any other ideas?

Harald.