got off the encoding
Hellow, i have some problem:
if a try to do it:
- textEdit->append(process->readAllStandardOutput());
//process is object of QProcess
i get it:
bq. áâ ®¢ª á¢ï§¨ á CORBINA…
஢¥àª ¨¬¥¨ ¨ ¯ à®«ï ¯®«ì§®¢ ⥫ï…
¥£¨áâà æ¨ï ª®¬¯ìîâ¥à ¢ á¥â¨…
áâ ®¢«¥ á¢ï§ì á CORBINA.
®¬ ¤ ãá¯¥è® § ¢¥àè¥ .
behind normal text, i try use toAscii(), toLocal8bit(), toUtf8(), toLatin1(), but i dont get normal text, how can i do it?
Advance many thanks for your help!
14 replies
The problem is probably not in the conversion from QString, but in the conversion to QString. The QProcess::readALlStandardOutput() function returns a byte array. You have to convert that to a QString using the proper encoding using one of the QString::from*() variants, or even explicitly stating an encoding. Probably you could go for QString::fromLocal8Bit(), but I’m not sure about that.
What kind of text does the process output?
I try use all QString::from*, but it is donr work
What kind of text does the process output?
I think, that it is must output russian text, as think Vass
Ruzik try toLocal8bit() to local QString, after it try using QTextCodec class for correct encoding
I try do it, but i get other strange simbols instead of normal signs:
- QString str;
- if(tc->canEncode(str))
- textEdit->append(tc->toUnicode(bArray));
QString str; if(tc->canEncode(str)) textEdit->append(tc->toUnicode(bArray));
You are worried about the outgoing encoding, but you forget the incoming encoding. This code makes no sense at all.
Get your incoming encoding right:
- // untested
- textEdit->append(str);
While you’re at it, check if codecForLocale() is actually the codec you need.
Process – rasdial.exe in Windows(http://msdn.microsoft.com/en-us/library/aa377004(v=vs.85).aspx )
Output on the russian language(on the my computer), but i dont know encoding of this process
You must log in to post a reply. Not a member yet? Register here!


