If I use:
HTML = u"<html><body>++\U00012000++</body></html>"
print qStr.toUtf8()
HTML = u"<html><body>++\U00012000++</body></html>"
qStr = QString(HTML)
print qStr.toUtf8()
To copy to clipboard, switch view to plain text mode
then the HTML string with the correct glyph in it is printed.
If I use:
#!/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>++%1++</body></html>"
# Main
widget.resize(320, 240)
widget.setWindowTitle("Hello, World!")
widget.show()
webView = QWebView(widget);
webView.setHtml(qStr);
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>++%1++</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(qStr);
webView.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
then the same problem occurs: a window pops up with: ++<two empty boxes>++.
Bookmarks