I’m trying to use the Localization Generator written by Joe Hosteny:
The idea behind it is simple.
For example, for Spanish, create a file named sp.yaml and fill it with
key value pairs:
Then when I need to translate a key into a value I do something like
@msg = l(:Spanish)
So everything seems to work okay if I put plain characters in sp.yaml.
Webrick, however, spazzes out if I put non-English characters in
=> Booting WEBrick…
iconv': "å© aqué±? como" (Iconv::IllegalSequence) from ./script/../config/../lib/localization.rb:62:inload_localized_strings’
each' from ./script/../config/../lib/localization.rb:61:inload_localized_strings’
open' from ./script/../config/../lib/localization.rb:60:inload_localized_strings’
each' from ./script/../config/../lib/localization.rb:52:inload_localized_strings’
… 8 levels…
require__' from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
Notice the msg:
./script/…/config/…/lib/localization.rb:62:in `iconv’: “å© aqué±? como”
It was caused by this line in my sp.yaml:
you_are_here_as: usted estÃ¡ aquÃ como
Obviously it had problems with
I used emacs to create sp.yaml and emacs asked me which character set
encoding I want to use.
I told it utf-8 and emacs saved sp.yaml just fine.
I pulled the actual characters from google and used my mouse to copy
them into emacs:
I checked the encoding my browser was using on the google page and it
told me it was using: UTF8
which I’ll assume is the same as the utf-8 I’m using in emacs.
Do any of you have some sample localization yaml files which you’d be
willing to share with me?
How about some general troubleshooting ideas?