cancel
Showing results for 
Search instead for 
Did you mean: 

How to print unicode as hexadecimal in textarea?

Exit0815
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief III
2 REPLIES 2
MM..1
Chief III

Try %2X or %02X

Exit0815
Senior

Thank you so much.

%02X did it.