Your Universal Remote Control Center
RemoteCentral.com
RTI Control Systems Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 2 made on Thursday August 20, 2009 at 11:53
snarfshark
Long Time Member
Joined:
Posts:
November 2006
257
On 1250708793, Just an Installer said...
I am trying to create a Pantel command set. Setting the Hex button to "on", and typing in the string as they appear in the Pantel 232 document, I seem to get odd characters appearing in my string.

I enter as follows (with the hex button set):

EA 05 26 03 18

( 0xEA 0x05 0x26 0x03 0x18 in Pantel document, component video input )

and when I save it, it shows as:

\xEA\x05&\x03\x18

Why am I getting the ampersand in the string after the 05 and the 26 is gone?

This is an ASCII representation of the hex string which you entered. The "\x" character sequence is an escape sequence which indicates that the 2 characters immediately following the "\x" are a hexadecimal value. This escape sequence is used to represent ASCII character codes which do not correspond to displayable (human-readable) characters.

The reason you are getting the ampersand is that it is the ASCII character which corresponds to the hex value 26 which you entered when you typed in the hex string. All of the other hex values you entered do not correspond to a displayable ASCII character, so the "\x" convention is used to represent the hex value.

Here's a table which shows the standard ASCII character set with decimal and hex codes for each character:
www.asciitable.com


Hosting Services by ipHouse