VK has asked for the wisdom of the Perl Monks concerning the following question:
Hello everyone.
My CGI scripts works with Cyrillic. "Works" means that:
- it contains unicoded Cyrillic literals
- it outputs unicoded Cyrillic
- it queries for unicoded JSON Cyrillic
- it receives and handles unicoded JSON Cyrillic (not UTF8-encoded sequences) like this: https://ru.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&list=allusers&auactiveusers&aufrom=Б
- I have use utf8; for script literals
- I have binmode STDOUT, ':utf8'; for "wide character" warnings
- I have JSON->new->utf8(0)->decode($response->content) for LWP query results, a simple decode_json from JSON module somewhere somehow mangles things
- I have my $unicode_literal = decode('utf-8', $data->{result}) from Encode module or else chars get jammed
- And a couple more things like this in other places
Back to
Seekers of Perl Wisdom