Dealing with binary data...

Q&A's, tips, howto's
Locked
statik
Posts: 58
Joined: Thu Apr 14, 2005 1:12 am

Dealing with binary data...

Post by statik »

I can do the following in perl:

Code: Select all

$ perl -e 'print "\xca\n"' 
Ê
$
And as you can see the \xca result is the Ê character. If I wanted to duplicate this very thing in newlisp, how would I do it?
-statik

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Try this:

Code: Select all

~> perl -e 'print "\xca\n"'
?
~> newlisp -e '(println (char 0xCA))'
?
"\202"
~> newlisp -e '(println "\202")'
?
"\202"
This would be the equivalent to the Perl code, what you see is largely dependent how you platform/terminal is configured. The above I did on a MacOS X PowerBook. I guess you did your example on MS-Windows with code page 859 with displayable characters in upper-ASCII.

Lutz

statik
Posts: 58
Joined: Thu Apr 14, 2005 1:12 am

Post by statik »

Nah, I actually did this on OBSD. But regardless, your solution was perfect. Thanks :)
-statik

Locked