Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > UnsupportedEncodingException

Thread Tools


Stefan Poehn
Posts: n/a

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. 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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
UnsupportedEncodingException Bill Lattery via Java 10 11-23-2004 08:49 AM
Re: UnsupportedEncodingException Jon A. Cruz Java 0 07-25-2003 03:43 AM