Any layer on standard handles will cause double encoding when a module like
Mojo::Log encodes to bytes before printing. These layers are global
unfortunately.
-Dan
On Sat, Oct 31, 2020 at 1:54 PM kon...@gmail.com wrote:
> I found a problem. Some module did:
>
> binmode STDOUT, ':encoding(UTF-8)
I found a problem. Some module did:
binmode STDOUT, ':encoding(UTF-8)';
binmode STDERR, ':encoding(UTF-8)';
and, probably, when STDERR was redirected to STDOUT by Mojo::Log then
double encoding occur.
Is it worth to check that STDERR and STDOUT have not same layers before
redirecting?
On Satu
I do nothing, except:
$app->log->info('тест лога');
and get at console:
[Sat Oct 6 15:22:43 2018] [info] �е�� лога
Should I configure console or add some options to app?
On Saturday, October 31, 2020 at 6:16:55 PM UTC+2 Sebastian Riedel wrote:
> Ok, data is encoded from UTF-8 into by
>
> Ok, data is encoded from UTF-8 into bytes when I log a message,
> but when this data is printed to STDERR
> How make it decoded from bytes to UTF-8 back?
> my terminal supports UTF-8 and I want see nice messages instead of ХабÐ
>
UTF-8 *is* bytes. If you are encoding already encoded UTF-
Hi.
Ok, data is encoded from UTF-8 into bytes when I log a message,
but when this data is printed to STDERR
How make it decoded from bytes to UTF-8 back?
my terminal supports UTF-8 and I want see nice messages instead of ХабÐ
On Wednesday, October 10, 2018 at 7:08:03 PM UTC+3 gri...@gmail.com
Mojo::Log already encodes data by default. Anything you send to stderr
outside of that should be encoded if necessary.
-Dan
On Wed, Oct 10, 2018 at 11:53 AM Alex Povolotsky wrote:
> So I should not binmode STDERR, ':utf8' if I'm using Mojo::Log and always
> explicitly encode() data?
>
> суббота
So I should not binmode STDERR, ':utf8' if I'm using Mojo::Log and always
explicitly encode() data?
суббота, 6 октября 2018 г., 20:30:12 UTC+3 пользователь Dan Book написал:
>
> The script is not quite correct. I suspect if you add "use warnings" you
> will see a "Wide character in print" warnin
The script is not quite correct. I suspect if you add "use warnings" you
will see a "Wide character in print" warning, because you are not encoding
your unicode characters to UTF-8 before printing them. However, on the
server where you are seeing the double encoding, perhaps you have a
PERL5OPT env