java - Under the IDEA environment of Windows 10, it is garbled when using jxl to read in the excel table and output Chinese
问题描述
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import java.io.*;
public class Myworkbook {
Workbook mybook ;
Sheet studentsheet;
Sheet schoolsheet;
public Myworkbook(String path) {
try {
mybook=Workbook.getWorkbook(new FileInputStream(path));
studentsheet=mybook.getSheet(0);
schoolsheet=mybook.getSheet(1);
} catch (IOException e) {
e.printStackTrace();
} catch (BiffException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Myworkbook mybook=new Myworkbook("C:\\Users\\Die-for-myself\\Desktop\\xiaoshengchu.xls");
System.out.println(mybook.schoolsheet.getName()+mybook.studentsheet.getCell(1,1).getContents());
}
}
The saving encoding is GB2312, which is using for Chinese.
解决方案
推荐阅读
- python - 如何通过烧瓶返回一个json文件而不保存在磁盘上?
- c++ - cv::Normalise() 中的 L2_NORM 和 NORM_MINMAX 实现有什么区别?
- python - 需要 NLTK“punkt”时 GitHub Actions 失败
- python - 需要一个可逆图像变换函数,使得:
- matlab - Matlab:如何合并两个哈希表?
- c++ - c++默认参数使用其他参数
- python - Python电报机器人降价
- mysql - SQL 错误 [1525] [HY000]:不正确的 DATETIME 值:''
- java - 错误:AMQ154003:无法使用 Wildfly 连接到 JMS ActiveMQ
- javascript - 从 Mongoose 查找查询返回值作为变量