0

I am working with TCP socket which I receive unicode data data for every 1 sec, data includes arabic text.

That unicode data I need to convert it to UTF8 and pass to JSON

How to convert unicode to UTF8 in blackberry 10 qt cascades.?

I am using the following code to convert but it is not working.

QString appTitle = QString::fromLocal8Bit(data2.toAscii());

I receive data in this format.

enter image description here

Community
  • 1
  • 1
user2085965
  • 393
  • 2
  • 13
  • 33
  • 2
    "Unicode" is not a concrete encoding. What does the data look like exactly? – deceze Oct 30 '13 at 15:20
  • I have added an image. How I receive data. Please have a look. – user2085965 Oct 30 '13 at 15:33
  • OK, yes, you're receiving Arabic text, in JSON, *possibly* UTF-8 encoded (but one can't tell from just a screenshot). What's your question again? – deceze Oct 30 '13 at 15:52
  • UTF-8 is one of several Unicode representations. You can convert from one representation to another if you know the representation of the input. It's likely that the input is *already* encoded as UTF-8. – Keith Thompson Oct 30 '13 at 16:12

0 Answers0