]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/text.cpp
update tex2lyx todo list
[lyx.git] / src / tex2lyx / text.cpp
index add0541b8f69a572fa6694cd196dbe3245fd9c60..50eee93a3d2291596ee63140d7afac665298232f 100644 (file)
@@ -159,7 +159,7 @@ const char * const supported_CJK_encodings[] = {
 "EUC-JP", "KS", "GB", "UTF8", 0};
 
 /**
- * the same as supported_CJK_encodings with .lyx names
+ * the same as supported_CJK_encodings with their corresponding LyX language name
  * please keep this in sync with supported_CJK_encodings line by line!
  */
 const char * const coded_supported_CJK_encodings[] = {
@@ -2119,6 +2119,25 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                have_CJK = false;
        }
 
+       // it is impossible to determine the correct encoding for non-CJK Japanese.
+       // Therefore write a note at the beginning of the document
+       if (is_nonCJKJapanese) {
+               context.check_layout(os);
+               begin_inset(os, "Note Note\n");
+               os << "status open\n\\begin_layout Plain Layout\n"
+                  << "\\series bold\n"
+                  << "Important information:\n"
+                  << "\\end_layout\n\n"
+                  << "\\begin_layout Plain Layout\n"
+                  << "This document is in Japanese (non-CJK).\n"
+                  << " It was therefore impossible for tex2lyx to determine the correct encoding."
+                  << " The encoding EUC-JP was assumed. If this is incorrect, please set the correct"
+                  << " encoding in the document settings.\n"
+                  << "\\end_layout\n";
+               end_inset(os);
+               is_nonCJKJapanese = false;
+       }
+
 #ifdef FILEDEBUG
                debugToken(cerr, t, flags);
 #endif