0

It's known that Qt allows to convert c-string (path to file (Windows), containing сyrillic characters) to another one encoded in UTF-8 as follows:

const char *str = "/path/to/some/file.ext";
const char *utf8str = QString(str).toUtf8().constData();

How can i do this without using Qt? What C- or C++-library can/should I use and is there any lightweight variant(s)?

peppe
  • 21,934
  • 4
  • 55
  • 70
bean
  • 9
  • 2
  • If I knew it, I would not tell you. Just for you misuse of the 'qt' tag. – Greenflow Sep 08 '13 at 14:53
  • `QString(const char *)` either is extremely dangerous (Qt 4) or uses fromUtf8() (Qt 5), thus making that step unnecessary. Not to mention the nice dangling pointer that creates. Besides, this question has nothing to do with Qt. – peppe Sep 08 '13 at 16:14

0 Answers0