On approximately 1/22/2004 2:01 PM, came the following characters from
the keyboard of Chuck Lee:

That's great.  Thanks guys.  I'm still a little confused as to how those
null characters got in there.  Oh well.

The leading "ff fe", if that data comes from a Windows file, implies that it was written in 16-bit Unicode. This is a function of the program that created the file, and perhaps some Windows settings. In 16-bit Unicode, all characters are 2 bytes, and if the characters are all ASCII characters, then the MSB of the two will be zero. If the file contains characters that are not ASCII, then some of the MSB may not be zero.


Simply eliminating the zero bytes, along with the first two characters, will perform a successful conversion from 16-bit Unicode to ASCII, if and only if all the characters in the file are ASCII characters (codes less than 128).


thanks Chuck

-----Original Message-----
From: $Bill Luebkert [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 4:52 PM
To: Chuck Lee
Cc: [EMAIL PROTECTED]
Subject: Re: Strange Problem


Chuck Lee wrote:


ff fe 0a 00 53 00 74 00 61 00 72 00 74 00 69 00 6e 00 67 00 20 00 69 00 6e
00 73
00 74 00 61 00 6c 00 6c 00 2c 00 20 00 70 00 6f 00 72 00 74 00 3a 00 20

00


38 0
0 30 00 2e 00 0a 00 0a 00 43 00 72 00 65 00 61 00 74 00 69 00 6e 00 67 00

20


00
77 00 65 00 62 00 20 00 68 00 74 00 74 00 70 00 3a 00 2f 00 2f 00 63 00 68
00 75
00 63 00 6b 00 30 00 35 00 2e 00 63 00 6f 00 6d 00 2e 00 0a 00 49 00 6e

00


73 0
0 74 00 61 00 6c 00 6c 00 20 00 63 00 6f 00 6d 00 70 00 6c 00 65 00 74 00

65


00
64 00 2e 00 0a 00

I take it the 00 means space?


No, 00 is a null character - 20 would be a space.  You'll need to
remove the null chars    $var =~ s/\x00//g;

--
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


_______________________________________________ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



-- Glenn -- http://nevcal.com/ =========================== The best part about procrastination is that you are never bored, because you have all kinds of things that you should be doing.

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to