UnsupportedEncodingException

S

Stefan Poehn

Hi

I have found a strange behavior in my program. Since Thursday I get an
UnsupportedEncodingException in a call
to new String(byte[] buf,String encoding); when I set encoding to "Cp850"
(DOS Latin1). It worked before with the same java code, the same classpath,
the same jdk directory and the same environment variables.

I assume the methods that solve the encoding use the classes
$JRE\lib\charsets.jar. What is really strange is that I can use the classes
in charsets.jar, e.g. sun.io.ByteToCharCp850 without changing the classpath
(and then encoding works perfect). Why does the constructor String(byte[]
buf,String encoding); not use the ByteToCharCp850 class?

What should I do when java.nio.charset.Charset.availableCharsets does not
return Cp850, and I need exactly this codepage for my program to work?

Thanks
Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top