[PATCH] BUG 172567 support non ASCII user name to login in

David Faure faure at kde.org
Tue Oct 14 11:53:49 BST 2008


On Monday 13 October 2008, 潘卫平 wrote:
> int main(int argc, char *argv[])
> {
>     //QCoreApplication app(argc, argv);
>     printf("%s\n", QFile::encodeName(QString::fromUtf8("/home/潘")).data());
>     return 0;    
> }
> the output is: 
> /home/
> 
> QFile::encodeName got wrong file name without a QCoreApplication object !

Yes, that's what Thiago said.
But now add
  setlocale(LC_ALL, "");
before the printf.
Now it works again, right?

That's how it's supposed to work in kdeinit4, except if maybe we do it too late.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list