i18n bug regarding Arabic-Indic numbers needinfo.
Diego Iastrubni
elcuco at kdemail.net
Fri Apr 23 22:52:56 BST 2004
ביום רביעי, 21 באפריל 2004, 09:28, נכתב על ידי Diego Iastrubni:
> ביום רביעי, 21 באפריל 2004, 09:17, נכתב על ידי Lars Knoll:
> > The conversion could be done by doing a toInt() followed by a
> > QString::number() or by asking for the digit value of every QChar, but
> > it's really up to the application to do proper processing here before
> > sending it of to an application expecting latin numbers.
ok..
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;
This piece of code works here. It transforms the number from any dialect
supported by QT into Latin. It should work. However, I don't have many ways
of testing it, so I send this here. Hopefully someone can confirm and test
this code (yes I know this is code should work, but I need to verify it).
Once the code is verified, I will integrate it into kppp. Somewhere in
connect.cpp around line 385. I am still looking into the code. Once I have a
final patch I will
Lars, if you want to incorporate this code into QString be my guest. I declare
this function public domain :)
--
diego, kde-il translation team
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
Free MS-Office replacement for most platforms
http://www.openoffice.org/
More information about the kde-core-devel
mailing list