I am trying to print the ascii value of the trademark symbol(ascii = 153, type it by holding Alt and type 0153 using numpad) using string to byte array, but it's returning the value 34,33. Interesting thing is it is returning 2 values.
I am attaching the vi here. Could anyone please take a look at it and let me know if it is a bug.
It also depends on the OS. The circled R maps to decimal 168 on the Mac.
Several extensions to the 7-bit ASCII set exist and not all are compatible.
You are entering two characters. Why don't you set your string control to hex display and enter 99 instead? You might also want to read this document.
Dumb question: If I press "alt", I cannot enter anything. It simply highlights the file menu (LabVIEW 2012)
It is easy to send byte patterns to a string control/indicator that cause the encoding to flip out, probably what happened here.
Change the input of the byte array to 2 elements: [0,153]
Run the VI: 'string' shows a space (null) + trademark symbol
Copy the 'ASCII' string, paste into 'string' indicator. Still looks like the trademark symbol.
Run the VI again: Mojibake.
Change the input of the byte array to [34,33]
Run the VI again: trademark
Ah, my laptop does not have a number pad...
Neither does mine, but it does have a Function (Fn) key which helps many of the keys serve double duty (the alternate values are tiny and colored purple). Amongst the alternate values are the number pad keys.
Yes, I know it's there somewhere, but I never use it, ever.
Fn-num-lock, then use some of the specially marked keys near the right (e.g. k=2, o=6)
Make that String Encoding + anything = headache
It's not that LabVIEW is particularly bad in that, just more limited than when you use for instance a C runtime library. But not so much for the worse, since getting string encoding right in a C program is a major pitta.
Having more freedom often isn't better especially in programming. And making string encoding right in a single platform application IS hard, making it right in a multiplatform way, is a project that nobody has fully tackled so far.