FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
Microsoft gunning for Adobe's PDF format?
Favorite Star Wars Character
The character of the teleplay "pretender"
ASCII ART
Perl server referencing
writing COM components in Perl
Programming in Assembly Language: x86 - reserved pixel?
HomePage
hashing your passwords
Apache
What are the rules for choosing a domain name?
Text Based Games?
Python Hex to character
Needed: perl module XML:Parser
Reply to topic    Frihost Forum Index -> Scripting -> Others

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