Commit a052ca0ad833a39e5a482b29d4cd37aafaad5cea
1 parent
ad2c27e8
Exists in
master
and in
67 other branches
FIX: Fix problem unicode
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
invesalius/reader/dicom.py
| @@ -1926,7 +1926,12 @@ class Image(object): | @@ -1926,7 +1926,12 @@ class Image(object): | ||
| 1926 | self.number = parser.GetImageNumber() | 1926 | self.number = parser.GetImageNumber() |
| 1927 | self.spacing = spacing = parser.GetPixelSpacing() | 1927 | self.spacing = spacing = parser.GetPixelSpacing() |
| 1928 | self.orientation_label = parser.GetImageOrientationLabel() | 1928 | self.orientation_label = parser.GetImageOrientationLabel() |
| 1929 | - self.file = parser.filename | 1929 | + |
| 1930 | + if (sys.platform == 'win32'): | ||
| 1931 | + self.file = parser.filename.encode(utils.get_system_encoding()) | ||
| 1932 | + else: | ||
| 1933 | + self.file = parser.filename.encode('utf-8') | ||
| 1934 | + | ||
| 1930 | self.time = parser.GetImageTime() | 1935 | self.time = parser.GetImageTime() |
| 1931 | self.type = parser.GetImageType() | 1936 | self.type = parser.GetImageType() |
| 1932 | self.size = (parser.GetDimensionX(), parser.GetDimensionY()) | 1937 | self.size = (parser.GetDimensionX(), parser.GetDimensionY()) |