Page 1 of 1

Dealing with binary data...

Posted: Wed Feb 01, 2006 1:33 am
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?

Posted: Wed Feb 01, 2006 2:07 am
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

Posted: Thu Feb 02, 2006 6:40 am
by statik
Nah, I actually did this on OBSD. But regardless, your solution was perfect. Thanks :)