Unicode character to readable format
I have received Unicode character like "\u000B\u000E\u000E\u001E\u000E\u000E\u000E\u0013\u000E\u0014\u000E\n"
I need to convert this in to readable format.
@eswar What do you mean with "readable". These characters are outside the letter/digit range and therefore cannot be displayed.
Do you want to dump them as hex? Which type is the variable that stores that characters?
Look at the UTF-8 encoding table. What you have are control chacters.
Do you want to do something like "show codes" that used to be in Wordperfect back in the 90s?
You might have to define your own unicode set to allow display of characters in a custom way. I have no idea what it takes to do such a thing.
or... change the font that has control characters as visible characters.
I actually want this for Qt. That way I can see the trailing spaces at the end of a line of code.
In Qt Creator:
Options->Text Editor->Display(tab)->Visualize Whitespace
Thanks for the reply. I need to convert this Unicode to string (Readble format).
That's the catch: these are control characters, they don't have a visual representation. You will to replace them yourself with something if you want to make them "readable".
Thanks for the reply.
These are escape sequence Unicode data receiving from UART. I need to convert these unicode data to Qstring.
That's what we are trying to make you understand: they already are in your QString but they have no visual representation. If you print the length of your string you'll see that it's not empty. You can process that string for whatever you need but you can't print anything readable.