]> git.lyx.org Git - features.git/commitdiff
Fix lyx2lyx for layout files with umlauts
authorGeorg Baum <baum@lyx.org>
Sat, 23 Feb 2013 11:23:29 +0000 (12:23 +0100)
committerGeorg Baum <baum@lyx.org>
Sat, 23 Feb 2013 11:23:29 +0000 (12:23 +0100)
lyx2lyx died with UnicodeDecodeError: 'ascii' codec can't decode byte if a
layout with a non-ASCII character in the file name was used, since the
textclass member of the LyX class was of type str, and not unicode.

lib/lyx2lyx/LyX.py

index 9a4763870e9eb0c6231db44877ddf3b70ebb3418..7e0276199b07d9f3c5b60fb27927942b076d0c1d 100644 (file)
@@ -330,6 +330,8 @@ class LyX_base:
         self.initial_version = self.read_version()
 
         # Second pass over header and preamble, now we know the file encoding
+        # Do not forget the textclass (Debian bug #700828)
+        self.textclass = self.textclass.decode(self.encoding)
         for i in range(len(self.header)):
             self.header[i] = self.header[i].decode(self.encoding)
         for i in range(len(self.preamble)):