[Qt] String encoding trouble in gnome
Hi,
I have a little qt frontend to wipe files with secure delete from within filemanagers. It does work from kde-filemanagers and stand-alone, but not from gnome. When I open files over a nautilus action, the filename ends up with a kind of html-encoding (%20 for space and so on). Please see this image to understand what I mean. http://s3.directupload.net/file/u/22...y83qyk_png.htm I have tried different encoding conversion functions like QString::latin1 and playing around with the options variables %F and %U with or without quotes. But it's all trial and error since I don't know where this encoding comes from. Any ideas ? Here is the relevant code, it's also highlighted in the image. Code:
void qwipe::init(int argc, char* argv[]) |
Hi,
Haven't played w/ Qt in a while, but if memory serves me right you may want to have a play w/: setPlainText So, if you find your strings to contain %something sequences (so if run under Nauseous) use the method above to convert your "url" to an actual file-system string. HIH. Cheers, Tink |
First I'd suggest taking your argv[i] and storing into an intermediary QString.
What do you get? I suspect the problem is there and so you might want to look at QString::fromLocal8Bit(). Possibly look at QTextCodec::codecForLocale() |
All times are GMT -5. The time now is 04:09 PM. |