This is driving me crazy. I have been two days converting my string from one type to another with no success.
I'm using Delphi Rio and I need to convert a string to HEX or DEC, but the string contains special characters, like á é í ó ú ñ or €.
For example, the 'á' character is 160 (dec) or A0 (hex). However, I'm getting 225, 145, 241 depending on the string type (ansichar, utf8, widechar...) but I don't know how can I get the real 160 value.
I need this because I want to send special characters to a bluetooth printer. If I send this:
edit1.text := 'áéíóú€$';
FSocket.SendData(TEncoding.ASCII.GetBytes(edit1.Text));
Printer receives this (HEX):
3F 3F 3F 3F 3F 3F 24
However, it should receive this (HEX):
A0 82 A1 A2 A3 D5 24
That's because I'm getting the wrong ASCII value for each character (63 is the ascii code for '?' character).
So... how can I send the real ASCII text to the printer? How can I get the real ascii code for 'á' (160)?
Please help!