* Dmitry Bigunyak via RT (bug-Mail-Box@rt.cpan.org) [091215 13:11]:
Show quoted text> Queue: Mail-Box
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=52754 >
>
> Agree with you, this is a real horror! For me this is the most difficult
> part for understanding in your project and I think it should be better
> described in documentation.
I'll try something for the next release.
Show quoted text> But now I have another magic problem. I attach the example script to
> describe the problem.
No, your code is still broken (in the Perl sense) If your source contains
utf-8 characters, then your file should start with 'use utf8;'
Show quoted text> I understand your solutions and they work fine, but in my project code I
> use Config::General module to get parameter charset and open config file
> with -UTF8 flag on.
The module is wrong. It should not translate -UTF8 in
open( $fh, "<:utf8", $file)
but use open( $fh, "<:encoding(utf-8)", $file)
Better to say in your code:
use encoding 'utf-8';
and not specify the -UTF8 option for Config::General.
All my code is unicode aware, but I hardly ever need a decode_utf8()
See man perlunicode(1)
Show quoted text> This is emulated with $charset = decode_utf8($charset);
> code in the example script. In this situation
> something goes wrong and I get bad text in arrived message. If I comment
> $charset = decode_utf8($charset); string everything is repaired. I can't
> explain what is happening...
Not in my environment. What's your $LANG setting? Mine is en_US.UTF-8
There is a difference between Perl's "utf8", and unicode "utf-8".
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net