Coldbox i18n question: When including accent chara...
# box-products
d
Coldbox i18n question: When including accent characters directly on my cf template, I see the output correctly .. á, é, í, ó, ú, ü, ñ, ¿, ¡ When using a resource file: { "hra": { "intro": { "accents" : "á, é, í, ó, ú, ü, ñ, ¿, ¡", ... and #getResource( "hra.intro.accents")# .. my result is ... á, é, Ã, ó, ú, ü, ñ, ¿, ¡ My html includes proper meta utf-8 encoding and have included the <cfprocessingdirective pageencoding="utf-8"> tag. As I am new to i18n, am I missing something? Thanks
p
If you are using Lucee, you probably need to check the encoding types in the admin...
d
Thanks for the reply. I am using Adobe CF, which should default to UTF-8.
p
Did you check which locale cbi18n is currently outputting and set to?
d
I am using i18n.setFWLocale("es_US"), prior to displaying the results from 'main_es_US.json' Seeing the results from the file, I'm assuming I have this set correctly. Is there something else the needs to be set?
For future reference, although the json file was saved as utf-8, after saving the file again as 'utf-8 BOM' ( notepad++ option ), the accents displayed properly.
p
Chasing down encoding issues is always such a pain, doubly so when things like the editor claim to be saving it correctly! Somehow it always brings to mind this XKCD: https://xkcd.com/927/