humble has asked for the wisdom of the Perl Monks concerning the following question:
Good time of the day, people.
I'm localizing perl script (from english to russian) and have problems w/ encoding when script prints to terminal (encoding utf-8).
I made a module (encoding utf-8) where is my collection of variables, now i translate it. Then i transfer those variables to the script through qw().
Problem is that after direct printing to terminal those variables give me unreadable characters, like ив.
I have tried to put
use Encode; binmode STDOUT, ":encoding(UTF-8)";
but it did not help me.
So, i have to decode every variable before use unless i do want to see the garbage:
$out=decode( "UTF-8", $out);My questions are:
1. Is there an easier way to output variables w/o need of decoding every variable?
2. Why i having variables' contetnt written in utf8 and terminal in utf8 - can not simply print it so it might be readable in russian?
3. May you have other (simpler) suggestions regarding localization of scripts?
Thanks for any advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems w/ encoding in terminal
by rjt (Curate) on Aug 06, 2013 at 12:04 UTC | |
by humble (Acolyte) on Aug 24, 2013 at 09:38 UTC | |
|
Re: Problems w/ encoding in terminal
by choroba (Cardinal) on Aug 06, 2013 at 11:43 UTC | |
by humble (Acolyte) on Aug 29, 2013 at 11:59 UTC | |
by choroba (Cardinal) on Aug 29, 2013 at 12:57 UTC | |
by humble (Acolyte) on Aug 30, 2013 at 05:23 UTC | |
by humble (Acolyte) on Aug 30, 2013 at 15:05 UTC | |
by choroba (Cardinal) on Aug 31, 2013 at 08:22 UTC | |
| |
by humble (Acolyte) on Aug 24, 2013 at 09:34 UTC |