在 Apache Poi 中打印 Unicode 字符

Print Unicode character in Apache Poi

我正在使用 Apache Poi 读取 Excel 文件。 在我的 excel 文件中有一行字符串值为:“ありガとう”

我用这个方法打印值:

cell.getStringCellValue()

结果:“??????”

我尝试使用方法:

new String(cell.getStringCellValue().getBytes("iso-8859-1"), "UTF-8")

出现相同的结果。

谁能解决这个问题,请帮帮我?

谢谢大家

因为您的控制台不支持此字符串表示的字符集。 在 Windows 中,通过 chcp 65001

将控制台更改为 utf8 页面