i18n bug regarding Arabic-Indic numbers needinfo.

Thiago Macieira thiago.macieira at kdemail.net
Sat Apr 24 18:07:32 BST 2004


Shaheed wrote:
>> 	QString num1 = QString::fromUtf8("٠٥٠-٦٦٧١١");
>>
>> 	for (unsigned int i=0; i<num1.length(); i++)
>> 	{
>> 		QChar c = num1[i];
>> 		if (c.isDigit())
>> 			c = c.digitValue() + '0';
>> 		num1[i] = c;
>> 	}
>>
>> 	cout << num1 << endl;
>
>I can confirm the Bengali equivalent works just fine:
>
>QString::fromUtf8("০৫০-৬৬৭৭১");

Of course, this will only work if you're converting digits (like a phone 
number) to and from base 10. If you stumble over a digit whose value is 
11, you'll end up with '0' + 11 = ';'.

Now, I don't know if there is any script in Unicode that uses base 12, 
20 or something else, but there's nothing stopping it.

As for numbers, not just a sequence of digits, you may want to be aware 
that some scripts may decide to put the least significant digit first, 
so you may have to reorder. But, again, I don't know if there is 
currently any such script in Unicode.

-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiago (AT) macieira (DOT) info
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040424/73346ab1/attachment.sig>


More information about the kde-core-devel mailing list