Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng-table export encoding to utf-8 hebrew letters #16

Open
ihabassi opened this issue Apr 8, 2015 · 8 comments
Open

ng-table export encoding to utf-8 hebrew letters #16

ihabassi opened this issue Apr 8, 2015 · 8 comments

Comments

@ihabassi
Copy link

ihabassi commented Apr 8, 2015

Hi,
I tried to export to a csv file using the ng table export. I need the hebrew letters but till didn't get a hebrew letter.

Can you help me with that?

Thanks

@thiagodp
Copy link

It appears that the library isn't exporting to UTF-8 correctly. Even using other languages - actually, other formats, such as latin-1 - we get the same problem.

The file is being exported to ANSI (you can see it using a hex editor, for example) instead of UTF.

Maybe it should using XRegExp (http://xregexp.com/) or some other lib, in order to support unicode RegEx...

@update: As pointed out by @davisford the problem is with the viewers, not with the file format.

@davisford
Copy link

AFAIK, a string in the DOM is UTF, and the plugin is doing nothing more than copying those strings into a big JS string. It's questionable whether JavaScript is UTF-16 or UCS-2...I guess it varies, but either way it shouldn't convert these to ASCII. Are you certain that whatever editor you are using to view them isn't changing the encoding or representation?

Why not try dumping the contents of the plugin's export string instead to the console and see if it still matches what you see in the DOM.

@thiagodp
Copy link

I thought that the regex filter would return an ANSI string, since it doesn't offer UTF support (e.g. "/u"). Actually, the output format is not changed.

I checked the content with these free/opensource hex editors: FreeHexEditor, Frhed, HexEdit, wxHexEditor, and Mh-Nexus. Surprisingly, none of them have proper UTF support (except for the paid version of the first one). Microsoft Excel has the same problem. It tries to show the file using ANSI (I couldn't find any option to change that). Just with a paid editor in trial version I could check the format. So, the problem was really with the editors I had used. This could possibly answer @ihabassi's question.

@davisford +1

@floydpink
Copy link

Since this repo was not being updated, we forked it and would welcome suggestions like these that could improve the library.

Check out https://github.com/kollavarsham/ng-table-to-csv

@zejli
Copy link

zejli commented Jun 1, 2015

Have you fixed the problem with the ngtableExport to csv? I have ANSI encoding instead of utf8.What should I do ?

@thiagodp
Copy link

thiagodp commented Jun 1, 2015

@zejli I recommend you to check your file viewer. Probably it is not opening the file in UTF-8 but in ASCII (see my comments above).

@zejli
Copy link

zejli commented Jun 2, 2015

Yes I know this is the problem.How can I fix it please!

@osde
Copy link

osde commented Jun 17, 2015

While openin with Open Office Calc it asks in which encoding to open, if you choose UTF-8 problem will be solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants