]> git.lyx.org Git - features.git/commitdiff
simplify ucs4 to utf8 conversion.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 14 Jan 2008 23:44:05 +0000 (23:44 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 14 Jan 2008 23:44:05 +0000 (23:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22577 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp

index aeece98bddc6e20b6b0b50b6757fdd69640a45a8..4f4d9ff5630454a6e255d9183443a39fdf8786b7 100644 (file)
@@ -53,7 +53,6 @@
 #include "support/lstrings.h"
 #include "support/Messages.h"
 #include "support/textutils.h"
-#include "support/unicode.h"
 
 #include <sstream>
 #include <vector>
@@ -1158,11 +1157,9 @@ void Paragraph::write(Buffer const & buf, ostream & os,
                        }
                        // this check is to amend a bug. LyX sometimes
                        // inserts '\0' this could cause problems.
-                       if (c != '\0') {
-                               vector<char> tmp = ucs4_to_utf8(c);
-                               tmp.push_back('\0');
-                               os << &tmp[0];
-                       } else
+                       if (c != '\0')
+                               os << to_utf8(docstring(1, c));
+                       else
                                lyxerr << "ERROR (Paragraph::writeFile):"
                                        " NULL char in structure." << endl;
                        ++column;