Java,读取具有 UCS-2 Little Endian 编码的文件
Java, Reading a file that has UCS-2 Little Endian encodeing
我正在尝试读取具有 UCS-2 LE 编码的 txt 文件,下面有以下代码。这 ???是我需要的编码变量,但我不确定它应该是什么。
InputStream HostFile = new FileInputStream(Location + FileName);
Reader file = new InputStreamReader(HostFile, Charset.forName(???);
PrintWriter writer = new PrintWriter(outLocation, "UTF-8");
如有任何想法,我们将不胜感激。
Reader file = new InputStreamReader(HostFile, Charset.forName("UTF-16LE");
我正在尝试读取具有 UCS-2 LE 编码的 txt 文件,下面有以下代码。这 ???是我需要的编码变量,但我不确定它应该是什么。
InputStream HostFile = new FileInputStream(Location + FileName);
Reader file = new InputStreamReader(HostFile, Charset.forName(???);
PrintWriter writer = new PrintWriter(outLocation, "UTF-8");
如有任何想法,我们将不胜感激。
Reader file = new InputStreamReader(HostFile, Charset.forName("UTF-16LE");