]> git.lyx.org Git - features.git/commitdiff
Start to export palin text in utf8 (no insets besides InsetText for now)
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 16 Aug 2006 11:56:06 +0000 (11:56 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 16 Aug 2006 11:56:06 +0000 (11:56 +0000)
* src/output_plaintext.C
(asciiParagraph): output utf8 instead of ucs4 garbage

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

src/output_plaintext.C

index 96d576556528adc05280d528a962d1cc750fd1bd..2327206b9f072a294e96c07cd245104aeec9bda2 100644 (file)
@@ -23,6 +23,7 @@
 #include "ParagraphParameters.h"
 
 #include "support/lstrings.h"
+#include "support/unicode.h"
 
 #include <fstream>
 
@@ -232,8 +233,9 @@ void asciiParagraph(Buffer const & buf,
                                "writeAsciiFile: NULL char in structure." << endl;
                        break;
 
-               default:
-                       word += c;
+               default: {
+                       std::vector<char> const tmp = ucs4_to_utf8(c);
+                       word.append(tmp.begin(), tmp.end());
                        if (runparams.linelen > 0 &&
                            currlinelen + word.length() > runparams.linelen)
                        {
@@ -244,6 +246,7 @@ void asciiParagraph(Buffer const & buf,
                        }
                        break;
                }
+               }
        }
        os << word;
 }