]> git.lyx.org Git - features.git/commitdiff
According to http://en.wikipedia.org/wiki/ISO-2022-JP, a character may be
authorEnrico Forestieri <forenr@lyx.org>
Thu, 20 Nov 2008 19:32:22 +0000 (19:32 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 20 Nov 2008 19:32:22 +0000 (19:32 +0000)
encoded using 1 or 2 bytes, but it may be prefixed by 3-byte escape sequence.
So, a single ucs4 char could need a maximum of 5 bytes. I think that it
is better to be safe than sorry...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27645 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/docstream.cpp

index bd2d010ff6e4e39f447df58391bc564a521babd0..682aa64d54d47d85f1a7d8d0908be3b09ce39624 100644 (file)
@@ -257,9 +257,10 @@ protected:
                    encoding_ == "GB" ||
                    encoding_ == "EUC-TW")
                        return 4;
-               else if (encoding_ == "EUC-JP" ||
-                        encoding_ == "ISO-2022-JP")
+               else if (encoding_ == "EUC-JP")
                        return 3;
+               else if (encoding_ == "ISO-2022-JP")
+                       return 5;
                else if (encoding_ == "BIG5" ||
                         encoding_ == "EUC-KR" ||
                         encoding_ == "EUC-CN" ||