Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Reading Korean Characters from .csv and displaying on LineEdit

Reading Korean Characters from .csv and displaying on LineEdit

Scheduled Pinned Locked Moved QML and Qt Quick
11 Posts 3 Posters 3.2k 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
    saad_saadi
    wrote on last edited by
    #1

    I am reading one .csv file,which has Korean Characters. I read the file but when I m displaying it on lineEdit, it is not correctly displayed. Please tell me how i can get rid of this problem.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Subst27
      wrote on last edited by
      #2

      Some like this:

      @QFile csvFile(csvName);
      if (!csvFile.open(QIODevice::ReadOnly | QIODevice::Text))
      {
      QMessageBox::critical(this,tr("Error"),tr("Can't open CSV file \n%1.").arg(csvName));
      return;
      }

      QTextStream csvStream(&csvFile);
      csvStream.setCodec("UTF-8");
      csvStream.setGenerateByteOrderMark(true);@

      And then reading data from the stream

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

        It's not working. I am using csvreader from this website "CSV-Reader":http://qtsimplify.blogspot.kr/2013/02/dealing-with-csv-files-easy-way.html. and i added the two lines as per your instructions but it didn't work. Any other solutions?

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          What encoding does your CSV file use? UTF-8, or EUC-KR, or something else?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • S Offline
            S Offline
            saad_saadi
            wrote on last edited by
            #5

            "UTF-8".

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Subst27
              wrote on last edited by
              #6

              Can you give me the file you want to read?
              I'm busy right now, but latter can try to work with it. You can send it to subst@int-security.ru

              1 Reply Last reply
              0
              • S Offline
                S Offline
                saad_saadi
                wrote on last edited by
                #7

                I sent you an email. Please check it. Thanks

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Subst27
                  wrote on last edited by
                  #8

                  I've got email, but my answer can't be send by email server. No matter. I can write here :)

                  Look the archive, link below . It's little project.

                  I read csv file and fill the listWidget with receiveing data (function openFileBtnClicked() in TMainWnd.cpp).

                  No 3-d party code. Easy and works fine. For your purpose you can take this code as a base. Then create needed tableModel and other what you want.

                  http://disk.tom.ru/fwub2f6

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    saad_saadi
                    wrote on last edited by
                    #9

                    Thanks for your help. I can not see any thing on the link. It's totally in Russian and also there is nor file or no code to see. Can you please look at it. Thanks

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Subst27
                      wrote on last edited by
                      #10

                      someone download file first :D on that sharing "delete after download" system of sharing by default. I've corrected, set "don't delete".

                      Try now

                      http://disk.tom.ru/ubtq3bt

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        saad_saadi
                        wrote on last edited by
                        #11

                        HI Subst27, I sent you an email. If you have time then kindly look at it. 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