I have found that working with Windows 2000 system files, that MS uses
UTF-16.  Try the following.


use Encode;

if (open(my $FH, "<:encoding(UTF-16)", $file)){
   # Do stuff...
   close $FH;
}

Howard A. Bullock
Computer Security
Tyco Electronics
717-810-3584
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rick
Nakroshis
Sent: Monday, June 06, 2005 12:43 AM
To: [email protected]
Subject: Win32 Unicode => ASCII ?

After several years of churning through massive amounts of ASCII with
Perl, 
I've ran into a stone wall when I tried to parse a exported text file
from 
System Information on my Win XP box.  Evidently it defaults to Unicode, 
which I've cheerfully ignored the last few years.

I'm using AS v5.8.3, but my head is swimming after trying to noodle
through 
the available documentation on Unicode.  Does some kind soul have an 
example of how to open and parse a Unicode file?  I haven't been so 
thoroughly stumped on a Perl problem in ages, and I've gotten no where
in 
everything I've tried.

Rick 

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to