diff --git a/CHANGELOG b/CHANGELOG index cf7a4efd42b87b6a59f4c915dd1d84d9d5954308..faabf931797d1ff9d3cebfabc09569f5dc84dfa1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -61,6 +61,7 @@ pyqtgraph-0.9.9 [unreleased] - Fixed ImageItem exception building histogram when image has only one value - Fixed MeshData exception caused when vertexes have no matching faces - Fixed GLViewWidget exception handler + - Fixed unicode support in Dock pyqtgraph-0.9.8 2013-11-24 diff --git a/pyqtgraph/dockarea/Dock.py b/pyqtgraph/dockarea/Dock.py index f83397c7ec5ab56932f77c3b6f49e987067eb455..d3cfcbb6fac611f0e0dc27be9069dbcd42fdd341 100644 --- a/pyqtgraph/dockarea/Dock.py +++ b/pyqtgraph/dockarea/Dock.py @@ -2,6 +2,7 @@ from ..Qt import QtCore, QtGui from .DockDrop import * from ..widgets.VerticalLabel import VerticalLabel +from ..python2_3 import asUnicode class Dock(QtGui.QWidget, DockDrop): @@ -167,7 +168,7 @@ class Dock(QtGui.QWidget, DockDrop): self.resizeOverlay(self.size()) def name(self): - return str(self.label.text()) + return asUnicode(self.label.text()) def container(self): return self._container diff --git a/pyqtgraph/dockarea/tests/test_dock.py b/pyqtgraph/dockarea/tests/test_dock.py new file mode 100644 index 0000000000000000000000000000000000000000..949f3f0ecaaba6eacc393badb821cfe360d3fc39 --- /dev/null +++ b/pyqtgraph/dockarea/tests/test_dock.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +#import sip +#sip.setapi('QString', 1) + +import pyqtgraph as pg +pg.mkQApp() + +import pyqtgraph.dockarea as da + +def test_dock(): + name = pg.asUnicode("évènts_zà héér") + dock = da.Dock(name=name) + # make sure unicode names work correctly + assert dock.name() == name + # no surprises in return type. + assert type(dock.name()) == type(name) diff --git a/pyqtgraph/python2_3.py b/pyqtgraph/python2_3.py index 2182d3a1ec5249b2a1fbd184aa606b9bd71f99e5..b1c46f2654dc5b2e42b67b7b5c5c55a88f54b9b3 100644 --- a/pyqtgraph/python2_3.py +++ b/pyqtgraph/python2_3.py @@ -1,5 +1,5 @@ """ -Helper functions which smooth out the differences between python 2 and 3. +Helper functions that smooth out the differences between python 2 and 3. """ import sys