Allow utf8x \inputencoding

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17164 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2007-02-13 17:36:55 +00:00
parent 65b1b08a5c
commit 9fd8a86961
5 changed files with 28 additions and 4 deletions

View File

@ -1,6 +1,10 @@
LyX file-format changes LyX file-format changes
-----------------------§ -----------------------§
2007-02-13 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* format incremented to 260: Allow utf8x \inputencoding
2007-02-12 Georg Baum <Georg.Baum@post.rwth-aachen.de> 2007-02-12 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* format incremented to 259: * format incremented to 259:

View File

@ -6,6 +6,11 @@
Encoding utf8 utf8 UTF-8 Encoding utf8 utf8 UTF-8
End End
# This one is used by many CJK packages. utf8 is supposed to be the successor,
# but does not have all features of utf8x yet.
Encoding utf8x utf8x UTF-8
End
Encoding iso8859-1 latin1 ISO-8859-1 Encoding iso8859-1 latin1 ISO-8859-1
End End

View File

@ -74,7 +74,7 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)),
("1_2", [220], generate_minor_versions("1.2" , 4)), ("1_2", [220], generate_minor_versions("1.2" , 4)),
("1_3", [221], generate_minor_versions("1.3" , 7)), ("1_3", [221], generate_minor_versions("1.3" , 7)),
("1_4", range(222,246), generate_minor_versions("1.4" , 3)), ("1_4", range(222,246), generate_minor_versions("1.4" , 3)),
("1_5", range(246,260), generate_minor_versions("1.5" , 0))] ("1_5", range(246,261), generate_minor_versions("1.5" , 0))]
def formats_list(): def formats_list():

View File

@ -1181,6 +1181,19 @@ def normalize_font_whitespace(document):
i = i + 1 i = i + 1
def revert_utf8x(document):
" Set utf8x encoding to utf8. "
i = find_token(document.header, "\\inputencoding", 0)
if i == -1:
document.header.append("\\inputencoding auto")
else:
inputenc = get_value(document.header, "\\inputencoding", i)
if inputenc == "utf8x":
document.header[i] = "\\inputencoding utf8"
document.inputencoding = get_value(document.header, "\\inputencoding", 0)
## ##
# Conversion hub # Conversion hub
# #
@ -1199,9 +1212,11 @@ convert = [[246, []],
[256, []], [256, []],
[257, [convert_caption]], [257, [convert_caption]],
[258, [convert_lyxline]], [258, [convert_lyxline]],
[259, [convert_accent, normalize_font_whitespace]]] [259, [convert_accent, normalize_font_whitespace]],
[260, []]]
revert = [[258, []], revert = [[259, [revert_utf8x]],
[258, []],
[257, []], [257, []],
[256, [revert_caption]], [256, [revert_caption]],
[255, [revert_encodings]], [255, [revert_encodings]],

View File

@ -141,7 +141,7 @@ using std::string;
namespace { namespace {
int const LYX_FORMAT = 259; int const LYX_FORMAT = 260;
} // namespace anon } // namespace anon