如何确定excel文件的字符编码? [英] How can I determine the character encoding of an excel file?

查看:3194
本文介绍了如何确定excel文件的字符编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

将Excel转换为采用UTF8编码的CSV

我有一个excel文件包含大量的全球客户数据。我不知道在文件创建时使用什么编码。

Scenario: I have an excel file containing a large amount of global customer data. I do not know what encoding was used when the file was created.

问题:如何确定excel文件中使用的字符编码,以便我可以正确导入另一个软件?

Question: How can I determine the character encoding used in the excel file so I can import it correctly into another piece of software?

推荐答案

对于Excel 2010,它应该是UTF-8。由MS指导:

http://msdn.microsoft.com/ en-us / library / bb507946

For Excel 2010 it should be UTF-8. Instruction by MS :
http://msdn.microsoft.com/en-us/library/bb507946:

SpreadsheetML文档的基本文档结构由表格和表格元素组成,引用工作表工作簿为每个工作表创建单独的XML文件。例如,具有两个工作表名称MySheet1和MySheet2的工作簿的SpreadsheetML位于Workbook.xml文件中,并显示在以下代码示例中。

"The basic document structure of a SpreadsheetML document consists of the Sheets and Sheet elements, which reference the worksheets in the Workbook. A separate XML file is created for each Worksheet. For example, the SpreadsheetML for a workbook that has two worksheets name MySheet1 and MySheet2 is located in the Workbook.xml file and is shown in the following code example.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
<workbook xmlns=http://schemas.openxmlformats.org/spreadsheetml/2006/main xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
    <sheets>
        <sheet name="MySheet1" sheetId="1" r:id="rId1" /> 
        <sheet name="MySheet2" sheetId="2" r:id="rId2" /> 
    </sheets>
</workbook>

工作表XML文件包含一个或多个块级元素,如SheetData。 sheetData表示单元格表,并包含一个或多个Row元素。一行包含一个或多个单元元素。每个单元格包含一个表示单元格值的CellValue元素。例如,工作簿中第一个工作表的SpreadsheetML(在单元格A1中只有值100)位于Sheet1.xml文件中,并显示在以下代码示例中。

The worksheet XML files contain one or more block level elements such as SheetData. sheetData represents the cell table and contains one or more Row elements. A row contains one or more Cell elements. Each cell contains a CellValue element that represents the value of the cell. For example, the SpreadsheetML for the first worksheet in a workbook, that only has the value 100 in cell A1, is located in the Sheet1.xml file and is shown in the following code example.

<?xml version="1.0" encoding="UTF-8" ?> 
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
    <sheetData>
        <row r="1">
            <c r="A1">
                <v>100</v> 
            </c>
        </row>
    </sheetData>
</worksheet>

检测单元格编码:

https:// metacpan。 org / pod / Spreadsheet :: ParseExcel :: Cells

http://forums.asp.net/t/1608228.aspx/1

这篇关于如何确定excel文件的字符编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆