Tag: utf 8

Javascript表格导出为ex​​cel utf8

我需要一些function,导出我的HTML表格作为Excel文件。 下面的代码这样做,但它保存在错误的字符集表。 我需要使它成为UTF-8。 这是我的代码: function exceller() { //UI var uri = 'data:application/vnd.ms-excel;base64; charset=UTF-8,', template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!–[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]–></head><body><table>{table}</table></body></html>', base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); }, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }); }; table = document.getElementById("pztable"); $('#toExcel').html($(table).html()); $('#toExcel').find("thead > tr > th:last-child").remove(); […]

VBA编码,.csv格式和分隔符的变化

我需要创build一个脚本,使用UTF-8编码并更改分隔符,将活动工作表保存为.csv文件。 我在VBA中是全新的,所以我在这里find了一些有用的代码。 唯一缺less的就是编码。 我试图自己没有成功。 Sub Zapisz_Arkusz_Jako_CSV() 'wg http://www.mcgimpsey.com/excel/textfiles.html Const myListSeparator As String = ";" Const myDecimalSeparator As String = "." Const myDateFormat As String = "yyyy-mm-dd" Dim Path As String Dim nFileNum As Long Dim myRecord As Range Dim myField As Range Dim myFieldText As String Dim sOut As String Path = Left(ActiveWorkbook.FullName, _ InStr(ActiveWorkbook.FullName, […]

replace脚本不能使用unicode txt文件

我正在尝试使用下面的代码在文本文件中用逗号replace所有的选项卡: Const ForReading = 1 Const ForWriting = 2 Const TristateTrue = -1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:\Users\Tom\Desktop\CSV.txt", ForReading, TristateTrue) strText = objFile.ReadAll strTab = vbTab strText = Replace(strText, strTab, ",") objFile.Close Set objFile = objFSO.OpenTextFile("C:\Users\Tom\Desktop\CSV.txt", ForWriting, TristateTrue) objFile.Write strText objFile.Close 但是,当为附件运行这个时,我得到错误: 第17行字符1无效的过程调用或参数 此文件是从Excel创build的unicode txt文件。 如果我打开文件并以UTF-8格式保存,我的代码将正常工作。 但是,我找不到在代码中进行这种转换的方式,而且没有出现乱码的结果。 任何人都可以帮我得到我的代码与原始的Unicode文本文件工作或find使用可执行代码(VBA /批处理)将文件转换为UTF-8的方式?

将XML数据导入XML会使用法语单词产生错误的字符

我有testing脚本(XML),我需要翻译(从Excel表)。 我从Excel表格中search英文单词,然后将它们翻译成德文,法文和意大利文。 我用法语单词有问题。 我在VBA中使用macros。 当我在英语中find相应的法语单词时,我正在使用函数Find 。 当我在Excel工作表中find法语单词时,我只是将int保存为String 。 码 If intChoice <> 0 Then strPath = Application.FileDialog( _ msoFileDialogOpen).SelectedItems(1) Dim strFolderPath As String strFolderPath = Left(strPath, Len(strPath) – 4) Set fGermanOutputFile = fso.CreateTextFile((strFolderPath & "_German.xml")) Set fItalianOutputFile = fso.CreateTextFile((strFolderPath & "_Italian.xml")) Set fFrenchOutputFile = fso.CreateTextFile((strFolderPath & "_French.xml")) Open strPath For Input As #1 Do Until […]

如何用UTF-8编码以Excel打开文本文件?

我有一个带“.tsv”扩展名的文本文件。 它有utf-8的enconding,它包含西里尔字符。 当我用“打开” – >“Excel”函数打开它时,Excel不显示正确的字符,而如果用同样的方法用Notepad ++打开它,我可以正确看到字符。 我想避免使用向导在Excel中导入文件。

使用UTF-8导入CSV

我使用下面的macros(感谢The_Barman代码!)将CSV文件导入名为Tickets的工作表中。 问题在于它有一些特殊的字符,所以我需要导入UTF-8格式的文件。 任何人都可以告诉我如何将此添加到此代码? 提前致谢! Sub CSV_Import() Dim ws As Worksheet, strFile As String Worksheets("Tickets").Range("A1:Z9999").Clear Set ws = ActiveWorkbook.Sheets("Tickets") strFile = "C:\test\testfile.csv" With ws.QueryTables.Add(Connection:="TEXT;" & strFile, Destination:=ws.Range("A1")) .TextFileParseType = xlDelimited .TextFileCommaDelimiter = True .Refresh End With End Sub

mb_convert_encoding如何工作?

我在将UTF-8数据导出到Excel时遇到了麻烦,但现在没关系,因为我发现了这一点: Microsoft Excel在.csv文件中损坏变音符号? 看这条线: echo chr(255) . chr(254) . mb_convert_encoding($csv, 'UTF-16LE', 'UTF-8'); 当我删除chr(255)。 chr(254)一开始Excel不能正常显示UTF-8数据,所以不能浏览器。 这当然不是问题,我只想知道为什么那些chr(255)和chr(254)是必不可less的。

字符编码,XML,Excel,Python

我正在阅读从另一个软件程序导入到Excel的XML文件的string列表。 我不确定excel文件的编码是什么,但是我非常肯定它不是windows-1252,因为当我尝试使用这种编码时,我遇到了很多错误。 现在引起我麻烦的具体的词是:“Zmysłowska,马格达莱纳”(注意“l”不是一个标准的“l”,而是通过它的斜线)。 我已经尝试了几件事情,我在这里提到其中三个: (1) page = unicode(page, "utf-8") page = unicodedata.normalize("NFKD", page) page = page.encode("utf-8", "ignore") Output: Zmys\xc5\x82owska, Magdalena Output after print statement: ZmysÅ‚owska, Magdalena (2) page = unicode(page, "utf-8") page = unicodedata.normalize("NFKD", page) Output: Zmys\u0142owska, Magdalena Output after print statment: Zmysłowska, Magdalena Note: this is great, but I need to encode it back […]

字节顺序标记为读取UTF-8 cvs和excel文件

友 我必须使用BOM(字节顺序标记)来确保以UTF-8格式下载的cvs和excel文件能正确显示。 ** 我的问题是可以将BOM应用于FileOutputStream而不是OutputStream如下所示? ** String targetfileName = reportXMLFileName.substring(0, reportXMLFileName.lastIndexOf(".") + 1); targetfileName += "xlsx"; File tmpFile=new File((filePath !=null?filePath.trim():"")+"/"+templateFile); FileOutputStream out = new FileOutputStream((filePath !=null?filePath.trim():"")+"/"+targetfileName); /* Here is the example*/ out.write(new byte[] {(byte)0xEF, (byte)0xBB, (byte)0xBF }); substitute(tmpFile, tmp, sheetRef.substring(1), out); out.close();

C#导出为Excel UTF-8问题

我想出口索姆数据到XLS ,但似乎有UTF-8编码的问题。 它输出正常,我得到Excel文件应该看,但是当插入的数据有特殊字符,在这种情况下,丹麦字符如æ , ø和å ,那么该文件是有点结果。 当我尝试在Excel中打开它时,出现读取文件时出现问题的消息,并将问题提及为设置spreadseet 。 我在几个通过validation的在线validation服务中运行了结果XMLvalidation。 当我在Notepad ++ XMLvalidation器中运行它时,在第一个发现的特殊字符(它是Å )中出现错误:XX行的XMLparsing错误:input不正确UTF-8,指示编码! 有人能指出那个男人吗? 我应该在哪里指出编码? 以下是结果XML的相关部分: <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Created>2006-09-25T13:34:53Z</Created> <LastSaved>2014-05-20T18:04:40Z</LastSaved> <Version>12.00</Version> </DocumentProperties> <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> <RemovePersonalInformation/> </OfficeDocumentSettings> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>7875</WindowHeight> <WindowWidth>14895</WindowWidth> <WindowTopX>360</WindowTopX> <WindowTopY>300</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> … </Styles> <Worksheet ss:Name="Ark1"> <Names> <NamedRange ss:Name="GIS34_Skade_V1_alle_koder" ss:RefersTo="=Ark1!R5C2:R28C2"/> </Names> […]