X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Ftext.cpp;h=50eee93a3d2291596ee63140d7afac665298232f;hb=8e7b5eebf0ef9742e5f6983d8f55f563c12a31ab;hp=add0541b8f69a572fa6694cd196dbe3245fd9c60;hpb=a3f4f2d1e3c2c9cb6907859a72e9e7e0592fbdc8;p=lyx.git diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index add0541b8f..50eee93a3d 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -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