PDA

View Full Version : Preserving filenames in QProcess



Pepe
20th June 2007, 19:07
I'm having a problem in Windows.

If I try to pass to another process (using QProcess) a filename containing Japanese, Chinese (or other alphabet) characters, these characters are lost (they are replaced by "?"), so the external process can't open the file.

I think QProcess is converting the filename to the system locale, but it must be doing wrong.

Is there any way to preserve those characters?

patrik08
20th June 2007, 22:00
I'm having a problem in Windows.

If I try to pass to another process (using QProcess) a filename containing Japanese, Chinese (or other alphabet) characters, these characters are lost (they are replaced by "?"), so the external process can't open the file.

I think QProcess is converting the filename to the system locale, but it must be doing wrong.

Is there any way to preserve those characters?


like e-mail encodeBase64 .







/* encode to name */
QString encodeBase64( QString xml )
{
QByteArray text;
text.append(xml);
return text.toBase64();
}

/* decode to name */
QString decodeBase64( QString xml )
{
QByteArray xcode("");;
xcode.append(xml);
QByteArray precode(QByteArray::fromBase64(xcode));
QString notetxt = precode.data();
return notetxt;
}