FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

perl printing of an ascii character

 


svecia
How do I 'cast' an integer to a char ?
I can print an ascii caracter like this
print "\x61";
And I get the outbut 'a'

But what if a want a variable printed as an ascii char
print "\x$mychr";

Then I just get the 61 if $mychar is set to 61
But the main issue is that I want to convert files containing
ascii input from differnt languages to unicode so if anyone has other
suggestions in that topic a reply would bee apriciated.
sonam
I don't know about perl, but sometimes in php I have something similar. In that case I separate string from variable. For example:

Code:
$char = "\x" . $mychr;
print $char;


Maybe this can work in perl, too.

Sonam
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.