对UCS-2进行解码(笔记)

1、UCS-2是16位的,进行解码时,UTF-16BE 和 UTF-16LE charset 忽略字节顺序标记;进行编码时,不写入字节顺序标记。

2、解码时将字节流转换为字符流
InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(
new File(new File(“”).getCanonicalPath() + “\bin\wz.txt”)), “UTF-16LE”);//UTF-16LE就是UCS-2

你可能感兴趣的:(笔记)