kcmdlineargs input decoding
jowenn at kde.org
Thu Mar 5 00:32:49 GMT 2009
Does this fix https://bugs.kde.org/show_bug.cgi?id=175907 also ?
I'm just catching up with the core-devel list and have no time to test it
On Wednesday 25 February 2009 18:50:38 David Faure wrote:
> On Wednesday 25 February 2009, Nick Shaforostoff wrote:
> > Hi. Opening files with non-ASCII names via cmd line in any KDE app
> > isn't possible on my system,
> > as args are misencoded due to QString::fromLocal8Bit() returning
> > different data before and after QApplication creation.
> > Attached patch fixes the issue by delaying conversion and moving it to
> > KCmdLineArgs::arg(),
> > as a side affect it switches KCmdLineArgs args processing to use
> > QByteArray internaly,
> > which is a little bit more memory efficient.
> Very interesting. Good patch IMHO.
> FWIW the attached patch fixes the issue too (qt-copy-trunk required,
> unpatched rc1 doesn't have the necessary exported symbol).
> @@ -263,8 +264,10 @@
> mStdargs = 0;
> // Text codec.
> + setlocale(LC_ALL, ""); // need to initialize "System" codec, i.e.
> iconv + extern Q_CORE_EXPORT bool qt_locale_initialized;
> + qt_locale_initialized = true;
> codec = QTextCodec::codecForLocale();
> - setlocale(LC_ALL, ""); // need to initialize "System" codec, i.e.
> // Qt options
> //FIXME: Check if other options are specific to Qt/X11
> But if you found a way to delay all the locale8bit conversions, that's even
> better. Please commit (to trunk).
"People's characters are strengthened through struggle against
difficulties; they are weakened by comfort." (Old Chinese adage)
KATE developer - Joseph Wenninger <jowenn at kde.org>
More information about the kde-core-devel