X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flyx2lyx%2Flyx_1_5.py;h=a57282b2561d669f6c60844636e9a0f039e58f33;hb=9fd8a869616cad617d0db8b022119c35855ea39d;hp=deae7fc3b5b3ad3e9cf3799e02ba4e327162d07e;hpb=5b79207f3d5121d259134d14584395cfd40cdb27;p=lyx.git diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py index deae7fc3b5..a57282b256 100644 --- a/lib/lyx2lyx/lyx_1_5.py +++ b/lib/lyx2lyx/lyx_1_5.py @@ -1181,6 +1181,19 @@ def normalize_font_whitespace(document): 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 # @@ -1199,9 +1212,11 @@ convert = [[246, []], [256, []], [257, [convert_caption]], [258, [convert_lyxline]], - [259, [convert_accent, normalize_font_whitespace]]] + [259, [convert_accent, normalize_font_whitespace]], + [260, []]] -revert = [[258, []], +revert = [[259, [revert_utf8x]], + [258, []], [257, []], [256, [revert_caption]], [255, [revert_encodings]],