Funny enough, StringBufferInputStream was deprecated, because it does not
handle character conversion well, which is exactly the state I have now
without being able to set the encoding myself.
Rene
PS: This being a monster group, I'd appreciate a mail copy of any replies,
unless your policies prohibit it.
mga...@gmx.de wrote:
> I realized that StringBufferInputStream is deprecated now. However,
> StringReader has no way of setting the encoding, and I was unable to find
> out, how to make a InputStreamReader from another Reader. So, what is the
> proposed way to set the encoding for a string reader?
There's no need. Readers are for *character* data, so you read a
character at a time. There's no conversion needed as it's constructed
with a Java String (unicode) and will read characters (unicode).
> Funny enough, StringBufferInputStream was deprecated, because it does not
> handle character conversion well, which is exactly the state I have now
> without being able to set the encoding myself.
That's because Streams are for bytes rather than characters.
When do you need to get the actual bytes? You can use String.getBytes()
to do the conversion in almost all cases I've seen.
> PS: This being a monster group, I'd appreciate a mail copy of any replies,
> unless your policies prohibit it.
Well, it's not *that* hard to set up most readers to just read the
headers, then you could easily find your own subject, but...
--
Jon Skeet - sk...@pobox.com
http://www.pobox.com/~skeet/
I admit it's a foolish question (shame on me). What I needed was a way to
decode the clipboard content (where the string comes from). Sorry.
Rene
--
--- Dale King