Re: Problems w/ encoding in terminalby rjt (Deacon)
|on Aug 06, 2013 at 12:04 UTC||Need Help??|
Provided you save your localization module with utf8 encoding, just include use utf8; in that module. See perlunicode, and Tom Christiansen's most excellent Stackoverflow answer on unicode. Here's an example you can work from:
English: Hello, Russian: привет
If you run this exact code with russian.pl encoded in utf8, and do not see the expected Cyrillic script, check your terminal settings and/or try another. Also beware if you are piping the output through other programs that are not aware of the encoding.
As a (sort-of) aside to your question, however, you might want to check out Locale::Maketext to save yourself the work of re-inventing a localization module.
use strict; use warnings; omitted for brevity.