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

UTF-8 chars mangled #30

Closed
cloakedninjas opened this issue Oct 21, 2014 · 4 comments
Closed

UTF-8 chars mangled #30

cloakedninjas opened this issue Oct 21, 2014 · 4 comments

Comments

@cloakedninjas
Copy link

I have the following in my UTF-8 encoded .po file:

msgid "Start date"
msgstr "Data de início"

After running the CLI command, I get the following JSON (again UTF-8 encoded file)

"Start date":[null,"Data de início"]

Pretty sure this is something at my end, but any pointers would be great 😄

@mikeedwards
Copy link
Owner

Hmm, what was the exact command you used? Any particular options?

@cloakedninjas
Copy link
Author

./node_modules/po2json/bin/po2json i18n/messages-pt-BR.po public/js/app/i18n/messages-pt-br.json

Running on a Mac, if that makes a difference?

@mikeedwards
Copy link
Owner

Hmm, could you post the header of your PO file in a gist? That might make a difference. It should look something like this (though with Portuguese instead of Polish):

msgid ""
msgstr ""
"Project-Id-Version: po2json\n"
"POT-Creation-Date: 2012-10-26 12:00+0000\n"
"PO-Revision-Date: 2013-11-08 09:09+0200\n"
"Last-Translator: Illimar Tambek <illimar.tambek@gmail.com>\n"
"Language-Team: po2json\n"
"MIME-Version: 1.0\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.7\n"
"Language: pl\n"

#: test.js:1
msgid "Hello, world!\n"
msgstr "Witaj, świecie!\n"

etc.

@cloakedninjas
Copy link
Author

Ah ha - that appears to be the issue, I have no header in my PO file, after copying your sample header into mine, the mojibake went away.

The source of my PO file was downloading directly from www.crowdin.net - I guess there's an issue at their end.

Thanks for your time

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

2 participants