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. PyQt5 textedit codepage
Forum Updated to NodeBB v4.3 + New Features

PyQt5 textedit codepage

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 501 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.
  • L Offline
    L Offline
    lipati
    wrote on last edited by
    #1

    position_list, result_list = get_one_image_result(self.file_name[0][self.curFileIndex])
    #print(result_list)
    strResult = self.dealRecogResultList(result_list)
    f = open(self.file_name[0][self.curFileIndex] + '.txt', 'w', encoding="utf-8")
    f.write(strResult)
    #outText = strResult.decode('utf-8')
    self.plainTextEdit_result.insertPlainText(strResul t)

    It's a application for windows desktop, i use a textedit to display some Chinese minority language characters, like:??????????????????????????.
    But it only displays some small black pieces.Even I use ctrl+C and ctrl+V to copy some characters from notepad to textedit, it displays the same small black pieces.
    PyQt5 cannot show this characters at all?
    alt text
    alt text

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you using a font that supports these characters ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you using a font that supports these characters ?

        L Offline
        L Offline
        lipati
        wrote on last edited by lipati
        #3

        @SGaist
        Thank for your reply. The problem is solved.
        It's my fault, i tried wrong font: self.setFont(QFont("宋体", 12))
        This font can display the characters correctly in notepad, but I realized this font does not support this character(the windows system is processed adaptively).
        So I download proprietary font and set it: self.plainTextEdit_result.setFont(QFont("hope", 12))
        and the problem is solved.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Glad you found a solution and thanks for sharing it.

          Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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