简体   繁体   English

在Apache Poi中打印Unicode字符

[英]Print Unicode character in Apache Poi

I'm using Apache Poi to READ Excel file. 我正在使用Apache Poi读取Excel文件。 In my excel file has a row with string value : "ありがとう" 在我的excel文件中有一行字符串值:“ありがとう”

I use this method to print value : 我使用这种方法来打印值:

cell.getStringCellValue()

The result : "?????" 结果 : ”?????”

I try to use method : 我尝试使用方法:

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

The same result appear. 出现相同的结果。

Do anyone how to solve this problem, please to help me ? 有没有人如何解决这个问题,请帮帮我吗?

Thank all. 谢谢大家

because your console not support the charset this string represent. 因为您的控制台不支持此字符串表示的字符集。 in Windows, change the console to utf8 page by chcp 65001 在Windows中,通过chcp 65001将控制台更改为utf8页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM