[Qt-interest] argv & utf-8 code
1+1=2
dbzhang800 at gmail.com
Sat Jul 31 17:16:28 CEST 2010
> Handler always fire if UTF-8 string appears , it will fail to open ,
how do you assign the utf-8 string to the QString fName ?
Debao
On Sat, Jul 31, 2010 at 10:55 PM, Aaron Lewis <aaron.lewis1989 at gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> In main() , i've got a simple class w , which has a function
> readFileToBuffer(QString fName).
>
> Well it's like this:
>
> In main():
> if(argc > 2){
> w.readFileToBuffer(QString(*(++argv)));
> }
>
> And in class codecs:
>
> void codecs::readFileToBuffer(QString fileName)
> {
> QFile file(fileName);
> if (!file.open(QFile::ReadOnly)) {
> // Hanlder, Popup a message , telling file can't be opened
> }
> }
>
> Handler always fire if UTF-8 string appears , it will fail to open ,
> it's problems with non-ascii strings , anyone could help ?
>
> I'm testing with KDE service menu , only successes when absolute path is
> totally ascii codes.
>
> Many thanks !
>
>
>
>
> - --
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4R0NL3WI5 on freenode
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.16 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkxUOVQACgkQvf41sEptMqBKyQCfXiaPcEmHBGnHuO2+3SLEsewU
> VM0AnizOzo5QlndXHnol0fngu7VARvul
> =0BSR
> -----END PGP SIGNATURE-----
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list