How to print unicode as hexadecimal in textarea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-05 12:54 AM
Hello,
i have a maybe simple question but i did not get it.
If i have an array of some unsinged chars, let`s say:
value[0] = 0xAA
value[1] = 0xAB
value[2] = 0x0B
and i want to print them together as "AAAB0B" in a textarea, what is the best way?
The problem is that i am losing the 0 from "0B" value.
Unicode::snprintf(txt1Buffer, TXT1_SIZE, "%X%X%X", 0xAB, 0xCD, 0x0F);
That gives me an output of:
ABCDF
But i want the leading zero. ABCD0F
How can that be done?
Thank you very much.
Solved! Go to Solution.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-05 5:09 AM
Try %2X or %02X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-05 5:09 AM
Try %2X or %02X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-05 5:26 AM
Thank you so much.
%02X did it.
