CharSets supported in android 4.2.1

304 views Asked by At

I'm getting following exception on android 4.2.1 device : nexus 7

java.nio.charset.UnsupportedCharsetException: Cp858 at java.nio.charset.Charset.forName(Charset.java:303)

2

There are 2 answers

0
Dan S On BEST ANSWER

Android documentation has a list of guaranteed Character Sets, The guaranteed ones are:

  • ISO-8859-1
  • US-ASCII
  • UTF-16
  • UTF-16BE
  • UTF-16LE
  • UTF-8

You can also use availableCharsets() to get a list or isSupported(String) to check for specific sets.

0
phdfong - Kenneth Fong On

You have any code to show us the exact problem? I believe you have to set the Charset (e.g. ISO-8859-1, utf-8, or etc)