-------- Original Message -------- Subject: RE: problem with encoding pragma Date: Mon, 21 Mar 2005 06:41:01 -0500 From: Malcolm Nooning <[EMAIL PROTECTED]> To: [email protected]
--------------------------------------------------------------------------------
Radomir Hejl thusly scribbled:
I for the first time tried to pack my script with -o foo.exe foo.pl and got a message 'Can't locate encoding.pm in @INC (@INC contains: CODE(0xee7e58) ...'. I get this message when the script has only a line with use encoding 'utf-8'; When I
Could you check whether encoding.pm has actually been packed into the PAR contained in foo.exe - you can list its contents with
unzip -l foo.exe
use pragma lib ('c:/perl/lib') the exe script runs ok.
That only papers over the problem: it makes foo.exe load the encoding.pm that's installed with your installation of Perl, so this won't work on a machine that hasn't Perl installed.
Why doesn't the Packager find this library path? It's in @INC.
Good question. I had similar problems on Win32, try adding
use Encode::Unicode;
as your first "use ...". My problem's visible clues where garbled characters in Tk widgets, too. The above line made it go away.
I use the encoding pragma to present also non ASCII characters with Tk widgets. These characters are hexa 100
You don't need "use encoding ..." (or "use utf8") for that. It's only needed when your script itself uses UTF8 characters (say, in literal strings).
gets to Tk widget as basic latin, not utf-8.
The problem in my case was even weirder: even ASCII characters were garbled in Tk widgets. The reason was that Encode::Unicode couldn't be loaded and Tk needs it internally to convert whatever your strings are encoded in to UCS2 which is used by the Windows display functions.
Cheers, Roderich
M. Nooning wrote:
>You don't need "use encoding ..." (or "use utf8") for that.
>It's only needed when your script itself uses UTF8 characters
>(say, in literal strings).
>
I had the same problem at one time. I was advised to put
use Encode::Unicode;
as the first line "use" in my program even though my program does not use it. I did, and the problem went away.
