Page 1 of 1

Error in character representation in a string

Posted: Fri Sep 13, 2019 3:24 pm
by tiny
I'm using FC8 last update on Windows 10, 1903.

If ASCII characters smaller than 32 or greater 126 are contained in a string, these are represented as hex numbers.
For normal programming, certainly no or only a small problem, but I would like to program an encryption tool and
because it may very well come to special characters in the key and the decryption is then a serious error.
This tool is a Vernam encryption that works very well under VB.
Now I want to port this tool to FC8 in order to transmit sensitive data encrypted.

Example of error: "Begründung" becomes "Begr\xfcndung" in the string.

Can someone please look at that?
Thanks
Christina

Re: Error in character representation in a string

Posted: Fri Sep 13, 2019 5:24 pm
by Benj
Hi Christina,

If the encrypted string contains NUILL characters then you may need to use a byte array instead of a string, a NULL would effectively mark the end of the string.

Otherwise a string should do exactly what you need it to. The print as hex is likely just done by the console or whatever you are using to see the data as the ASCII character may not be printable.

Re: Error in character representation in a string

Posted: Fri Sep 13, 2019 9:21 pm
by tiny
Hello Ben,
I found this mismatch in the simulation, so I'm going to test that routine inside the MCU.

Many thanks
Christina