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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -