Hello and thank you for reading my post.
I am simply using the following code to print UTF-8 encoded Unicode characters on the console in hexadecimal format:
1 2 3 4 5 6 7 8
|
int n_i;
int n_posCursorInBuffer;
char bufferChars[100];
[...]
for(n_i=0 ; n_i<n_posCursorInBuffer ; n_i++)
{
printf("%x ", bufferChars[n_i]);
}
|
The original (UTF-8 encoded Unicode) character being 志, that is to say "E5 BF 97" in hexadecimal format, here is what is printed on the console:
ffffffe5 ffffffbf ffffff97 |
Do you know what are these 6 leading "f"s in front of "e5", "bf" and "97"?
Note that, if the original (UTF-8 encoded Unicode) character is "F" for instance (46 in hexadecimal format), what is printed on the console is 46 (and not ffffff46).
Can you explain this behaviour?
Is it normal?
Can these "f"s be removed and how?
Thank you for helping.
Best regards.
--
Léa Massiot