How can I get text encoding system explicitly in Qt? -
it's easy turn string qtextcodec *
following:
char *str = "utf-8"; qtextcodec *codec = qtextcodec::codecforname(str);
but can inverse? example:
qtextcodec *codec = qtextcodec::codecforname("system");
but how can turn codec
string know encoding system utf-8/utf-16 or others?
but how can turn codec string know encoding system utf-8/utf-16 or others?
by using qtextcodec::name() const
.
char *str = "utf-8"; qtextcodec *codec = qtextcodec::codecforname(str); qbytearray name = codec->name(); // "utf-8"
Comments
Post a Comment