
Originally Posted by
bhaskar
QTextCodec *utf8Codec = QTextCodec::codecForName("eucKR");
This is just a wild guess, but the naming suggests it. You call the codec utf8Codec but set it up to decode EUC-KR. Those two encodings are not the same. Are you sure the source is EUC-KR and not UTF-8?

Originally Posted by
bhaskar
for english font is ok but for korean font font is currupting
It might be worth printing the string in hexadecimal form so you can check to see if it’s the string that isn’t what you expect, or if the problem has something to do with the font or the way it’s being used. (If there’s a simple way to print out in hexadecimal, I don’t see it; I think you have to loop through the string one character at a time, something like this:
for (int i
= 0; i < tmpStr.
length();
++i
) hexprint
+= QString("%1 ").
arg((unsigned short) (tmpStr
[i
]),
4,
16,
'0');
QString hexprint = "";
for (int i = 0; i < tmpStr.length(); ++i) hexprint += QString("%1 ").arg((unsigned short) (tmpStr[i]), 4, 16, '0');
To copy to clipboard, switch view to plain text mode
to get a printable string in hexadecimal.)
Bookmarks