I have an external module that returns me a few lines. I'm not sure how exactly the rows will return. I really don't know how Unicode strings work and why.
The module should return, for example, the Czech word "být", which means "to be." (If you do not see the second letter, it should look like this .) If I display the string returned by the module using the Data Dumper, I see it as b\x{fd}t.
However, if I try to print it with print $s, I received the warning "Wide character in print" and? instead of ý.
If I try Encode::decode(whatever, $s);, the resulting line cannot be printed in any way (always with the warning "Wide character", sometimes with distorted characters, sometimes on the right), regardless of what I put in whatever.
If I try Encode::encode("utf-8", $s);, the resulting CAN string can be printed without problems or error messages.
If I use use encoding 'utf8';, printing works without the need for encoding / decoding. However , if I use the module IO::CaptureOutputor Capture::Tiny, it starts to scream “Wide character” again.
I have a few questions, mainly about what exactly is happening. (I tried to read perldocs, but I was not very wise of them)
- Why can't I print a line immediately after it is received from the module?
- , "decode"? ""?
- "" ?
use encoding ? utf-8?- , - , ?
edit: -C binmode PERL_UNICODE. . - UTF8- STDOUT. , , .
edit2: , "" ( ).