PDA

View Full Version : Unable to display selected unicode characters



nickw2066
19th November 2012, 10:20
Hello,

I'm using: PyQt4, OS X 10.7.5

My system has fonts to display both unicode characters 0x1200 and 0x1250 (that is, both glyphs display fine in Mac's character viewer).

However, with PyQt, I'm getting some strange behaviour. For example:


#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on 19 November 2012

@author: nick
'''

import sys

from PyQt4.QtGui import QApplication, QWidget
from PyQt4.QtWebKit import QWebView

# Constants

HTML = u"<html><body>++؀؀\u1250++</body></html>"

# Main

app = QApplication(sys.argv)

widget = QWidget()

widget.resize(320, 240)
widget.setWindowTitle("Hello, World!")
widget.show()

webView = QWebView(widget);
webView.setHtml(HTML);
webView.show()

sys.exit(app.exec_())

displays the correct character in the window, but if I change the HTML string to:


HTML = u"<html><body>++؀؀\u1200++</body></html>"

only "++<empty box>++" displays.

Why might this be?