X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flyx2lyx%2Funicode_symbols.py;h=d9eeff96835d81b0e9fe0b46a8ed63e56360add0;hb=b35fb98335b1fff52ac0a266d45e48579427dbf8;hp=f24f3a918710390d5d744b35e272e923899cfcf6;hpb=a2f127f8c38d10bc9b4414ea522640b64adb5b77;p=lyx.git diff --git a/lib/lyx2lyx/unicode_symbols.py b/lib/lyx2lyx/unicode_symbols.py index f24f3a9187..d9eeff9683 100644 --- a/lib/lyx2lyx/unicode_symbols.py +++ b/lib/lyx2lyx/unicode_symbols.py @@ -29,7 +29,12 @@ if not PY2: def read_unicodesymbols(): " Read the unicodesymbols list of unicode characters and corresponding commands." pathname = os.path.abspath(os.path.dirname(sys.argv[0])) - fp = open(os.path.join(pathname.strip('lyx2lyx'), 'unicodesymbols')) + filename = os.path.join(pathname.strip('lyx2lyx'), 'unicodesymbols') + + # For python 3+ we have to specify the encoding for those systems + # where the default is not UTF-8 + fp = open(filename, encoding="utf8") if (not PY2) else open(filename) + spec_chars = [] # A backslash, followed by some non-word character, and then a character # in brackets. The idea is to check for constructs like: \"{u}, which is how