turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 155 forks source link

Problem when displaying Spanish "ñ" character #406

Closed alexvazquez closed 3 years ago

alexvazquez commented 3 years ago

I have my "message.po" having the following:

#: Views\Account\NewLogin.cshtml:57
msgid "Password"
msgstr "Contraseña"

When I change the language to Spanish, what I get is this: Contrase�a

Seems some encoding is not working correctly while getting the translation values from the message.po.

Any clue? Appreciate it

alexvazquez commented 3 years ago

By some reason the message.po generated by the i18n.PostBuild.exe doesn't convert the file to UTF-8. Dont know if there is a way to generate it by default. I converted to UTF-8 using the following Powershell command and now the encoding issues are gone.

Get-Content .\messages.po | Set-Content -Encoding utf8 messages-utf8.po

turquoiseowl commented 3 years ago

Is it possible the file encoding got modified at some point? I'm pretty sure we do create the PO files as UTF-8, and if we didn't it would have been flagged before.

turquoiseowl commented 3 years ago

Also make sure your messages.pot file is UTF-8. The assumption is that all files, including all source code files, are UTF-8.

alexvazquez commented 3 years ago

Also make sure your messages.pot file is UTF-8. The assumption is that all files, including all source code files, are UTF-8.

I dont think it was got modified at some point. Well maybe when I edited in Visual Studio but I dont think VS will change the encoding. Anyway this was a fix in case someone else have the same problem. Appreciate will do that.

turquoiseowl commented 3 years ago

Roger that, thanks.