GithubHelp home page GithubHelp logo

UTF-8 Problem about jquery-table2excel HOT 17 CLOSED

rainabba avatar rainabba commented on June 16, 2024
UTF-8 Problem

from jquery-table2excel.

Comments (17)

ferman2147 avatar ferman2147 commented on June 16, 2024 3

@erayaydin @rainabba I have finally found the solutions after trying everything I could. In the table2excel.js file at line 29, where the head is defined for e.template, I added this meta tag:

<meta http-equiv=\"content-type\" content=\"application/vnd.ms-excel; charset=UTF-8\">

right before the

<head>

tag

from jquery-table2excel.

rainabba avatar rainabba commented on June 16, 2024

It definitely sounds like a unicode issue and I'm guessing that the html entity/escaped character (like ® or ®) doesn't work in Excel the same as in the browser and if that's the case, there's nothing I can do here. If you can copy/paste, then there's some hope, but the issue will likely be something I cannot support.

Can you copy/paste those same characters directly from the browser into Excel?

from jquery-table2excel.

ferman2147 avatar ferman2147 commented on June 16, 2024

Hi @rainabba,
About @erayaydin's issue, I'm having the same problem. base64 decoding for Turkish characters such as "İ,ı,Ğ,ğ,ş,ç,ö..." doesn't work properly. ( it encodes those characters into some weird set of symbols. ) How can we add a custom character replacing function to our table2exe.js file? Or is there any suggestion that you can give to solve this problem? (I think what we need to enhance is around line 60 in the file. But I might very well be wrong beacuse I'm only a beginner in jQuery.)

from jquery-table2excel.

rainabba avatar rainabba commented on June 16, 2024

If you can confirm whether or not you can copy/paste those characters from the browser into Excel, then I'll better know what options might be available. My instinct says that something should be available to address this since multi-language unicode characters are common, but it's also not an area I have any real experience with in JS.

I wonder if this hints at the issue and possible solutions: http://stackoverflow.com/questions/60825/international-characters-in-javascript

from jquery-table2excel.

ferman2147 avatar ferman2147 commented on June 16, 2024

Copying from browser to Excel is NOT the issue. Since Excel and all other office programs have Turkish language support, you can write those character directly to Excell, or copy/paste from anywhere. Here is a picture that shows characters are fine with Excel.
adsiz

from jquery-table2excel.

rainabba avatar rainabba commented on June 16, 2024

Thanks for the suggestion ferman2147. I just setup a rainabba-patch-utf8 branch but can't test yet so I created a pull request. If someone wants to try that branch and report back, I can commit to master quickly otherwise I will test when I can and commit then.

By the way, can I ask where you guys found out about my plugin? Suddenly it seems very popular :)

from jquery-table2excel.

erayaydin avatar erayaydin commented on June 16, 2024

I tried manually (not branch) and its working!

from jquery-table2excel.

ferman2147 avatar ferman2147 commented on June 16, 2024

Well, I'm working on a web based CRM for a company and they make quotation forms for customers, and they want it in excel. To this point, it's all great. I make them fill a contenteditable table, and when they are finished they click on a button and magic! Excel is ready thanks to your plugin. But now they wanna view those excel forms (which they upload and store each URL in database) online when needed. That's where things go south for me :) I can't get the excel files created by your plugin to be readable. But I appreaciate your work. It's very useful.

from jquery-table2excel.

lomholdt avatar lomholdt commented on June 16, 2024

I have tested @ferman2147's suggestion and it works perfectly. Definitely a good suggestion for merging to master.

Also I Googled 'Excel export' and found this. This subsequently lead to here 👍

from jquery-table2excel.

ignacio-chiazzo avatar ignacio-chiazzo commented on June 16, 2024

@ferman2147 I have tried your hint but it didn't work.

In the table2excel I have :

e.template = {
  head: "<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>",
  sheet: {
      head: "<x:ExcelWorksheet><x:Name>",
      tail: "</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>"
  },
  mid: "</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body>",
  table: {
      head: "<table>",
      tail: "</table>"
  },
  foot: "</body></html>"
};

And just below the head tag, I added the line that you said, but it didn't work.

Thanks in advance.

from jquery-table2excel.

Gaohaoyang avatar Gaohaoyang commented on June 16, 2024

@ferman2147 Thanks, it's worked in Chinese Charactor!

from jquery-table2excel.

GuvenAydin avatar GuvenAydin commented on June 16, 2024

@ferman2147 Thank you bro

from jquery-table2excel.

gogodjzhu avatar gogodjzhu commented on June 16, 2024

@ferman2147 It works in Chinese! Thank you!

from jquery-table2excel.

ferman2147 avatar ferman2147 commented on June 16, 2024

You're welcome guys.
@ignacio-chiazzo I'm sorry I haven't been around for a long time. In case you might still need help, I edited my comment, it's clearer now. You should add that above head tag, not below. I mean right before it, because above and below terms will need line break tweaks. Let's stick with "right before" :)

from jquery-table2excel.

xiao-ai avatar xiao-ai commented on June 16, 2024

@ferman2147 a tag works perfect. Thanks, man!

from jquery-table2excel.

SahilGarg3shapes avatar SahilGarg3shapes commented on June 16, 2024

This doesn't work for me. I can copy russian language text to excel but when i export russian text it doesn't work.

I added below line before tag and even tried after tag as well but that doesn't work for me. See text "PASTED_MY_LINE_HERE" i replaced this text with below line.
"<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">";

e.template = {
head: "<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\">PASTED_MY_LINE_HERE ",
table: {
head: "

",
tail: "
"
},
foot: ""
};

Please advice.

from jquery-table2excel.

Etchanty avatar Etchanty commented on June 16, 2024

@ferman2147 it's working. I tried to complete it, Thank you

from jquery-table2excel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.