Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread Dan Book
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)

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread kon...@gmail.com
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

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread kon...@gmail.com
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

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread Sebastian Riedel
> > 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-

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread kon...@gmail.com
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

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2018-10-10 Thread Dan Book
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? > > суббота

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2018-10-10 Thread Alex Povolotsky
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

Re: [Mojolicious] Re: Mojo::Log and UTF-8

2018-10-06 Thread Dan Book
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