in reply to Re: Is there some universal Unicode+UTF8 switch?
in thread Is there some universal Unicode+UTF8 switch?
> So your script itself is in UTF-8?
Well, not really. Other already reminded to us that UTF-8 is merely a "transport protocol" for multibyte chars - not what you see and get in the text. So if I have in my code like my $Cyrillic_literal = 'here some Cyr letters but perlmonks.org replaces it with HTML-escapes'; - it is not UTF-8, it is Unicode. If you select and copy that here some Cyr letters but perlmonks.org replaces it with HTML-escapes - you buffer will contain Unicode string, not UTF-8 string. So the proper word would be use unicode; and not use utf8; But it is not me who has chosen the module name, I'm just an end user. It can be called utf8 or even foobar - as long as does the needed (Unicode handling) I do not care too much.
> If the JSON Cyrillic is not UTF-8, what encoding is it in?
It is in Unicode. You want UTF-8 - call like this (see formatversion changed to 1): https://ru.wikipedia.org/w/api.php?action=query&format=json&formatversion=1&list=allusers&auactiveusers&aufrom=Б
The major problem of Perl as I see it (see the module name question higher) that it thinks of UTF-8 and Unicode as something of the same kind while these are two completely different things. From here all its (de|en)coding oops. IMHO.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Is there some universal Unicode+UTF8 switch?
by daxim (Curate) on Sep 02, 2019 at 11:02 UTC | |
by VK (Novice) on Sep 02, 2019 at 11:21 UTC | |
by daxim (Curate) on Sep 02, 2019 at 12:19 UTC | |
by VK (Novice) on Sep 02, 2019 at 14:00 UTC | |
by haj (Vicar) on Sep 02, 2019 at 15:13 UTC | |
| |
Re^3: Is there some universal Unicode+UTF8 switch?
by haj (Vicar) on Sep 02, 2019 at 12:08 UTC | |
Re^3: Is there some universal Unicode+UTF8 switch?
by Anonymous Monk on Sep 02, 2019 at 10:25 UTC | |
by VK (Novice) on Sep 02, 2019 at 11:05 UTC | |
by haj (Vicar) on Sep 02, 2019 at 12:17 UTC | |
by VK (Novice) on Sep 02, 2019 at 12:46 UTC | |
by haj (Vicar) on Sep 02, 2019 at 13:12 UTC | |
|