in reply to Re: pp module messes encoding
in thread pp module messes encoding

It means: that I tried to convert the text result with:
utf8::encode, utf8::decode, utf8::upgrade, & utf8::downgrade,
and none converted the extracted text with the .exe version, to what was extracted in the .pl version.

umm.. that was the script.
I can't demonstrate the problem with a shorter script, because the Hebrew characters can't be shown right without my writeFile function, since Padre (or perl, not sure) doesn't support utf8 chars (like Hebrew chars) by default.

Replies are listed 'Best First'.
Re^3: pp module messes encoding
by GrandFather (Saint) on May 14, 2011 at 04:41 UTC

    The following works fine for me in a utf8 savy console (Komodo output window actually):

    use strict; use warnings; use utf8; my $str = 'עוד להיט'; binmode STDOUT, ":encoding(utf8)"; print $str;

    It's important to note that whatever is rendering your script output must be capable of handling whatever unicode characters you throw at it. If this script doesn't work right in the context you are having trouble then the fault is not with Perl but with the context.

    Update: Note that PerlMonks has munted the unicode characters :-(. The original script used Unicode characters for the string, not entities. The following also works and uses HTML entities in place of the unicode characters:

    use strict; use warnings; use utf8; use HTML::Entities; my $str = 'עוד להיט'; binmode STDOUT, ":encoding(utf8)"; print HTML::Entities::decode ($str);
    True laziness is hard work
      good idea thx.
      Tried both over my extracted text but none returned it to it's normal form.
      also tried decode_entities but still didn't help.
      also tried without the use utf8; and the binmode STDOUT, ":encoding(utf8)";
      but still same problem remains.
        but still same problem remains.

        What debugging steps have you taken?

Re^3: pp module messes encoding
by Khen1950fx (Canon) on May 14, 2011 at 02:07 UTC
    You forgot binmode STDOUT, ":encoding(utf8)";
Re^3: pp module messes encoding
by Anonymous Monk on May 14, 2011 at 08:58 UTC
    umm.. that was the script.

    But you're still not showing how you're invoking pp