[Fedora-trans-ar] Re: Arabic issue #32: The conversion of a localized 'const QString' to 'double' returns 0

Munzir Taha munzirtaha at newhorizons.com.sa
Sat May 7 19:59:15 UTC 2005


On Yaum al-Sabt 28 Rabi` al-Awal 1426 01:54, you wrote:
> I would say that depends on whether or not you've called
> QTextCodec::setCodecForCStrings() to tell it bare const char * and
> QByteArray should be interpreted as utf-8 (I believe the default is
> latin-1, but I'd probably be explicit if I was using anything other than
> ascii).

Thanks a lot Puetz for your reply but what's confusing me is if I can
    QLocale::setDefault(QLocale::German);
    d = QString( "1234,56" ).toDouble(&ok); // ok == true, d == 1234.56
without calling QTextCodec::setCodecForCStrings() or trUtf8, why not for 
QLocale::Arabic? Is this because the German comma is within ascii range? Is 
this justified? Is it for performance reasons that the default is latin-1 and 
not utf8?

> > > 	QLocale ar(QLocale::Arabic);
> > > 	double d = ar.toDouble( "١٢٣" );

> > Now I found if I do it like this:
> >         d = arabic.toDouble(QObject::trUtf8("١٢٣"));
> >
> > It works! Should I consider this bug as invalid?


-- 
Munzir Taha  PGP Key available
gpg --recv-keys --keyserver www.mandrakesecure.net F0671821

Telecommunications and Electronics Engineer
Mandrake Club Member
Maintainer of the OpenBugs project page at
http://www.arabic-fedora.org/munzir/OpenBugs.html
Maintainer of Fedora Arabic Translation Project
https://listman.redhat.com/mailman/listinfo/fedora-trans-ar
Master CIW Designer, ICDL, MOUS, Linux+, LPI 101
New Horizons CLC, Riyadh, SA




More information about the Fedora-trans-ar mailing list