Error in character representation in a string

Moderator: Benj

Post Reply
User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Error in character representation in a string

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Error in character representation in a string

Post 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.

User avatar
tiny
Posts: 200
Joined: Wed Jul 08, 2009 8:29 am
Has thanked: 51 times
Been thanked: 93 times
Contact:

Re: Error in character representation in a string

Post 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

Post Reply