I don't think it's a string-combining problem, as even this:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on 7 November 2012
@author: nick
'''
import sys
from PyQt4.QtWebKit import QWebView
# Constants
CUNE_STR = u"\U00012000"
HTML = u"<html><body>++\U00012000++</body></html>"
# Main
#qStr = QString(HTML).arg(QString(CUNE_STR))
widget.resize(320, 240)
widget.setWindowTitle("Hello, World!")
widget.show()
webView = QWebView(widget);
webView.setHtml(HTML);
webView.show()
sys.exit(app.exec_())
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on 7 November 2012
@author: nick
'''
import sys
from PyQt4.QtCore import QString
from PyQt4.QtGui import QApplication, QWidget
from PyQt4.QtWebKit import QWebView
# Constants
CUNE_STR = u"\U00012000"
HTML = u"<html><body>++\U00012000++</body></html>"
# Main
#qStr = QString(HTML).arg(QString(CUNE_STR))
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_())
To copy to clipboard, switch view to plain text mode
where I make no use of QString, still only produces a box with: "++<two empty boxes>++"
Considering unicode characters < 0xFFFF, I'm getting some strange behaviour. For example:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on 7 November 2012
@author: nick
'''
import sys
#from PyQt4.QtCore import QString
from PyQt4.QtWebKit import QWebView
# Constants
#CUNE_STR = u"\U00012000"
HTML = u"<html><body>++؀؀\u1250++</body></html>"
# Main
#qStr = QString(HTML).arg(QString(CUNE_STR))
widget.resize(320, 240)
widget.setWindowTitle("Hello, World!")
widget.show()
webView = QWebView(widget);
webView.setHtml(HTML);
webView.show()
sys.exit(app.exec_())
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on 7 November 2012
@author: nick
'''
import sys
#from PyQt4.QtCore import QString
from PyQt4.QtGui import QApplication, QWidget
from PyQt4.QtWebKit import QWebView
# Constants
#CUNE_STR = u"\U00012000"
HTML = u"<html><body>++؀؀\u1250++</body></html>"
# Main
#qStr = QString(HTML).arg(QString(CUNE_STR))
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_())
To copy to clipboard, switch view to plain text mode
displays the correct character in the window, but if I change the HTML string to:
HTML = u"<html><body>++؀؀\u1200++</body></html>"
HTML = u"<html><body>++؀؀\u1200++</body></html>"
To copy to clipboard, switch view to plain text mode
only "++<empty box>++" displays (EDIT: My system seems to have the font to display this glyph because it displays correctly in Mac's Character Viewer).
Bookmarks