Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Character encoding #24

Closed
scientiacloud opened this issue Jan 15, 2016 · 9 comments
Closed

Character encoding #24

scientiacloud opened this issue Jan 15, 2016 · 9 comments

Comments

@scientiacloud
Copy link

When exporting a language file to CSV the special characters are not copied across properly:
export default { weekdays: ['Terça', 'Sábado'], }
becomes:
weekdays: ['Terça', 'Sábado']

Am I doing something wrong?

@kellyselden
Copy link
Owner

Am I doing something wrong?

Probably not. I will add those to my test cases and see if I can figure out what's going on.

@kellyselden
Copy link
Owner

I added the keys to my test cases here #26 and my tests still passed. At this point I'm not sure what the problem is. Did you alter the csv using Excel or OpenOffice or change the encoding?

@FredUK
Copy link

FredUK commented Jan 18, 2016

Hi there, I have not changed anything. Just ran ember-i18n-csv to-csv --locales-path=publish/ --csv-path=i18n.csv and opened the CSV file in Excel.

However by creating an empty excel document and going to "Data - Import - From text", select the CSV file and go to the "Text Import wizard" screen and in there the "file origin" was identified to be Windows (ANSI). I changed it to UTF-8 and it worked fine. Not sure why Excel is defaulting it to Windows (ANSI) but apparently I found out what the problem was. Thanks for your speedy reply.
More information regarding CSV UTF-8 here: http://stackoverflow.com/questions/6002256/is-it-possible-to-force-excel-recognize-utf-8-csv-files-automatically/6488070#6488070

Update: Even after succesfully importing the data, when converting back to js it still gives me character problems:
image .

No idea what the problem might be..

@kellyselden
Copy link
Owner

I think your problem is Excel related. If you generate the CSV, then reimport the CSV again without opening it in Excel, it works right?

@FredUK
Copy link

FredUK commented Jan 18, 2016

Hi Kelly, you're correct. I have just tried to open the unchanged file in other editors (how didn't I think of that before??!) and they all display it properly. Also converting it back to json works flawlessly.

As soon as it opened in Excel it show's gibberish with the special characters. If I tell excel to import the CSV as UTF-8 it then shows properly in Excel but saving it will ruin it for all other programs.

Basically it can't read the translation file properly while all other text editors can; you tell it to force UTF-8 and it works fine. You tell it to save it as a new CSV file (still works fine on excel) but not for any other program..Pff..

My apologies for wasting your time. Thanks a lot.

@kellyselden
Copy link
Owner

No problem, I would welcome an addition to our readme to document the troubles with Excel for other users if you have time.

@kellyselden
Copy link
Owner

@scientiacloud @FredUK I have added Excel instructions that have worked for me 0ab8787

@FredUK
Copy link

FredUK commented Feb 4, 2016

Thanks, in the end I decided to use Google Docs (Sheets) to maintain the translation files instead of using Office 👍 . This way is also easier to add collaborators to the translations.

@kellyselden
Copy link
Owner

@FredUK Sounds good.

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

No branches or pull requests

2 participants