nikolay has asked for the wisdom of the Perl Monks concerning the following question:
Have a good time of the day.
Am i correct in supposing that there is no way to read an array (in UTF-8 encoding) w/ «do» -- in case the array contains non-english characters?
I tried this way:
File «q» contains:
q~(?^u:йцу(\W))~, qq~фыв$1~
Script:
use utf8::all; use Encode; # This reads unreadable characters. @a=do 'q'; # So, i decode this (notwithstanding utf8::all usage): $a[0]=decode( 'UTF-8', $a[0] ); $a[1]=decode( 'UTF-8', $a[1] ); # I save the decoded data (for later usage): open SVITOK, '>q'; $sod='q~'.$a[0].'~, qq~'.$a[1].'~'."\n"; print SVITOK $sod; close SVITOK; # Now, i read it again. -- That reads unreadable characters again. @a=do 'q';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: do to read from UTF-8 files/array.
by choroba (Cardinal) on Sep 16, 2015 at 13:57 UTC | |
by nikolay (Beadle) on Sep 18, 2015 at 09:54 UTC | |
by choroba (Cardinal) on Sep 18, 2015 at 10:19 UTC | |
|
Re: do to read from UTF-8 files/array.
by Anonymous Monk on Sep 16, 2015 at 13:34 UTC | |
by choroba (Cardinal) on Sep 16, 2015 at 13:46 UTC |