Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 29th March 2006, 23:59
spinoza spinoza is offline
Junior Member
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs down Perl non-printable chars and unwanted formatting

I have a problem using perl to print certain non-visable characters. Simply put, the code I'm working from appear to assume that the following statement will output one byte.

perl -e 'print "\x90";'

However, filtering with wc -c or redirecting to file shows that the statement is actually producing two bytes. A hex viewer shows that the 2nd byte is the correct 0x90, but it is proceeded by a 0xC2 byte. This also occurs with other non-printable characters, but not with printable characters.

I'm quite new to both linux and perl so I'm not sure whether I'm doing something wrong here or whether I've just misunderstood the purpose of the original program. All the web searches and perl reference texts appear to show that the statement is correct and only one byte should be output. Is this extra byte some kind of formatting byte ?

I'm using Redhat 9 and using perl in a bash shell running in a terminal window.

I would appreciate it if anyone could help with this.

Thanks.
Reply With Quote
Sponsored Links
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.