0

I have a QString which contains a japanese string. But while debugging its just showing "???" in place of string. I need it to display it in qml. I have used QtextCodec but didnt work for me. Please give any solution or suggestion to fix the issue.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Anoop AR.
  • 118
  • 1
  • 12

2 Answers2

0

Have you tried this?

label->setText(QString::fromLocal8Bit("日本語"));
akky
  • 2,818
  • 21
  • 31
0
  1. Save source file in UTF-8 (or other which can encode your characters) encoding

  2. Set default codec with QtextCodec (I've tried, and it is working without this setting, too).

  3. Use label->setText(QString::fromWCharArray(L"日本語"));

Nemanja Boric
  • 21,627
  • 6
  • 67
  • 91