The stupid question is the question not asked | |
PerlMonks |
Re: same utf8 string is different in console and in browser (Sybase)by choroba (Cardinal) |
on Aug 19, 2017 at 17:46 UTC ( [id://1197665]=note: print w/replies, xml ) | Need Help?? |
This can happen when one of the strings is utf-8, while the other one is bytes. Compare: #! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use utf8; my @strings = ('школы', "\xd1\x88\xd0\xba\xd0\xbe\xd0\xbb\xd1\x8b"); say for @strings; binmode STDOUT, ':encoding(UTF-8)'; say for @strings; The first two lines are the same: школы школы but once the output knows it expects UTF-8 (the third and fourth line), the output is different: школы ΡΠΊΠΎΠ»Ρ You probably didn't tell Sybase your strings are UTF-8.
In Section
Seekers of Perl Wisdom
|
|