develooper Front page | perl.macosx | Postings from August 2009

Mac + Windows question

From:
John Delacour
Date:
August 2, 2009 03:58
Subject:
Mac + Windows question
Message ID:
p0624080bc69b172953b1@[192.168.1.68]
The problem is simple, but here is the background:

I'm writing an interactive script that needs to work on both Mac and 
Windows running in Terminal on the Mac and in the "Perl Command Line 
Interpreter" (ActivePerl 5.10) on Windows.

The script and the text files it reads from are all utf-8 encoded and 
display properly on both platforms.  At the moment I am using Windows 
2000 for testing, since that's all I have here, though I have another 
machine with XP at another location.

Now for the problem:

If the script detects that it is running in Windows then I use 
Encode::from_to to convert the utf-8 to cp1252 for display in the 
"Perl Command Line Interpreter" console and for output.  Output is 
fine, but non-ascii characters in the console window are wrongly 
displayed -- for example:

         Citroën is displayed as CitroÙn
         Microsoft® as Microsoft«
         - as ù

and yet when these incorrectly displayed characters are printed to 
the output file they are correctly printed, so the problem seems to 
be merely the "Interpreter's" interpretation of how to display the 
characters.

Does anybody know what charset this frightful console is using?

JD




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About