Skip to content

Instantly share code, notes, and snippets.

View phye's full-sized avatar
🎯
Focusing

Philip Ye phye

🎯
Focusing
View GitHub Profile
@phye
phye / Perl Excel Chinese Processing
Last active August 29, 2015 14:05
Note for Chinese Excel Processing in Perl
== 引言 ==
最近要用Perl写个处理包含中文的XLSX文件的小脚本,折腾了好半天才搞定中文处理,记录下来方便日后查询。
== 背景 ==
* 读XLSX文件使用[[https://metacpan.org/pod/Spreadsheet::XLSX|Spreadsheet::XLSX]]
* 写XLSX文件使用[[https://metacpan.org/pod/Excel::Writer::XLSX|Excel::Writer::XLSX]]
* *Microsoft Excel 2007* 之后的xlsx格式,实际是ZIP+XML(将xlsx文件重名名为zip,而后再用winzip提取文件就可看到内部的xml文件),所以只能是utf-8编码。
{{{
--- eg.xml ---
<hello>大家好<\hello>