Dealing with binary data...

Started by statik, January 31, 2006, 05:33:39 PM

Previous topic - Next topic

statik

I can do the following in perl:



$ perl -e 'print "xcan"'
Ê
$


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

#1
Try this:



~> perl -e 'print "xcan"'
?
~> 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

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