Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Chinese Character in Qt
Forum Updated to NodeBB v4.3 + New Features

Chinese Character in Qt

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    saravanavelu39
    wrote on last edited by
    #1

    Hi friends,

    I have one problem in chinese character using in qt,, in the application window chinese characters are displayed correctly,,But when i take the receipt from the printer chinese characters are merged,,please give me some suggestion,, Thanks

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NetZwerg
      wrote on last edited by
      #2

      quite uninformative question. Not sure whats the problem or the result should be. Show some code, current situation and desired situation so someone may help.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        saravanavelu39
        wrote on last edited by
        #3

        In here i just pass the string

        @@QString ItemPushButton::name_check(QString str)
        {
        QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
        QRegExp [removed]"#([0-9]+);");
        QStringList list,list1;
        int pos = 0;
        int length;
        while((pos = expression.indexIn(str,pos))!=-1)
        {
        list << expression.cap(1);
        QString v;
        length = expression.matchedLength();
        v=str.mid(pos+1,length-1-1);
        QByteArray ba = v.toUtf8();
        QString str1 = QString(QChar(v.toInt()));
        list1 <<str1;
        pos += expression.matchedLength();
        }
        foreach (QString s, list) {
        str.replace(s,"");
        }
        str = str.replace("#","");
        str = str.replace(";","");

        foreach (QString s, list1) {
            str = str.append(s);
        }
        return str;
        

        }@

        This return string is a chinese character,, I displayed this string in Qpushbutton,,In here chinese characters are displayed correctly,, But i pass this string to template and take the print means in the receipt chinese character are overwrite,,(i.e) If i pass the three chinese character means in the receipt bill it displayed 5 chinese character,,please give a suggestion,,,Thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved