在Android中有文本数据的编解码工具类,可以用于各种unicode与ascii字符串编码格式的转换,如下表:
Charset | Acharset is a named mapping between Unicode characters and bytesequences. |
CharsetDecoder | Aconverter that can convert a byte sequence from a charset into a16-bit Unicode character sequence. |
CharsetEncoder | Transformsa sequence of 16-bit Java characters to a byte sequence in someencoding. |
CoderResult | Usedto indicate the result of encoding/decoding. |
以上工具类存在于:
java.nio.charset
源代码路径是:
libcore/luni/src/main/java/java/nio/charset/