hhurz / tableExport.jquery.plugin

jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
MIT License
990 stars 716 forks source link

The downloaded file encoding problem with content in Chinese #281

Closed caidwang closed 5 years ago

caidwang commented 5 years ago

Awesome work! But when using it, I met some problem with encoding format. The file downloaded (only xls and csv tested) by plugin is encoded in UTF-8 while the MS Excel required gb18030 to open rightly.

My web server is running on CentOS7 and my browser is Chrome running on Win10. The Win10 system default encoding format for Chinese is gb18030 (I guess) and so does MS Excel. When I download csv or xls file using plugin, the default encoding format is UTF-8 which cases mass in displaying Chinese in Excel. After opening the file with Editor and changing the encoding to gb18030, the Excel can display Chinese rightly.

I wonder if there is any option to force the encoding of file to be others.

中文编码存在问题, 在win10系统下下载包含中文的csv或xls文件后, excel不能够正确打开, 只有通过例如vs code修改文件的编码格式为gb 18030后, excel才能够正常打开。