How to include unicode in QString???



  • can any body help me to do this?

    This is a unicode and I want to convert it to unicode characters

    @
    QString name="مم"; //تثتإتؤنفننننننتنت"; //bidi example
    @

    I wrote this code to remove &# into u and deigits into hexa

    @
    QString name="مم"; //تثتإتؤنفننننننتنت"; //bidi example
    int off=0;
    QString Outp;
    while(index>=0)
    {
    QRegExp [removed]"&#[0-9][0-9][0-9][0-9];"); //
    index=expression.indexIn(name, off);
    qDebug () << "index" << index;
    int length = expression.matchedLength();
    if (index==-1) break;
    QString v;
    v=name.mid(index+2,length-2-1);
    QString re;
    re=name.mid(index,length);

    qDebug() << "v=" &lt;&lt; v &lt;&lt; "re=" &lt;&lt; re;
    
    uint r=v.toInt(0,10);
    
    qDebug() &lt;&lt; "int=" &lt;&lt; r;
    
    uint decimal = r;
    QString haxadecimal;
    haxadecimal.setNum(decimal,16);
    
    
    if (haxadecimal.length()==3)
    {
        haxadecimal= "0" + haxadecimal;
    }
    
    QString a= "\\x" + haxadecimal.mid(1,2) + "\\x" + haxadecimal.mid(3,2);
    

    @

    but i can not continue, it does not work ... help required

    thank you


  • Moderators

    Closing this thread. Please do not duplicate posts.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.