0

How I can export from library function UTF8 encoded string?

    extern "C" __declspec(dllexport) QString Test()
{
    QString tmp = "日本";
    return tmp;
}
Dmitro
  • 1,870
  • 3
  • 16
  • 25
  • what compiler? The source file is UTF-8? I don't remember but, I think, visual studio only suports ascii or UCS-2 encoded files. It does compile? – joy Dec 21 '12 at 11:15

1 Answers1

2
QTextCodec::setCodecForCStrings( QTextCodec::codecForName("utf8") );

helped.

Dmitro
  • 1,870
  • 3
  • 16
  • 25