Using Javascript "charCodeAt" to read string characters sent by Spinneret
highplainsbubba
Posts: 34
I managed to figure out my own problem so I thought I would share it in case others had the same issue. I was using the Spinneret to read a DIO card that sent the status of inputs by serial bus using hex. If all 8 inputs were on, it would send a ÿ character (Hex 255) to the Spinneret. I then sent that character to the browser and used Javascript "charCodeAt" to get the hex value of that character. That worked great for everything less that $7F (the standard ASCII character set 0-127) but it wouldn't display the character code for characters in the ASCII control code range above $7F (128-255). After a lot of research, I found this webpage http://www.w3schools.com/tags/ref_urlencode.asp
Which stated :
URLs can only be sent over the Internet using the ASCII character-set.Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
URLs cannot contain spaces. URL encoding normally replaces a space with a + sign.
I will have to convert the character codes to hex at the Spinneret and then send the hex value to the browser. I
Which stated :
URLs can only be sent over the Internet using the ASCII character-set.Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
URLs cannot contain spaces. URL encoding normally replaces a space with a + sign.
I will have to convert the character codes to hex at the Spinneret and then send the hex value to the browser. I