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 <konk...@gmail.com> wrote: > 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 Saturday, October 31, 2020 at 6:16:55 PM UTC+2 Sebastian Riedel wrote: > >> 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-8 then you are >> double encoding. >> >> -- >> sebastian >> > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mojolicious+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/mojolicious/f276d64e-f215-47d8-af7b-893d9c200ef4n%40googlegroups.com > <https://groups.google.com/d/msgid/mojolicious/f276d64e-f215-47d8-af7b-893d9c200ef4n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/CABMkAVX4mqdx6m0HPR8fo5owa4B6rixb9i4bsocimop5755GEQ%40mail.gmail.com.