PyQt5 textedit codepage
lipati last edited by
position_list, result_list = get_one_image_result(self.file_name[self.curFileIndex])
strResult = self.dealRecogResultList(result_list)
f = open(self.file_name[self.curFileIndex] + '.txt', 'w', encoding="utf-8")
#outText = strResult.decode('utf-8')
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?
Hi and welcome to devnet,
Are you using a font that supports these characters ?
lipati last edited by lipati
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.
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 :)