SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.8k stars 1.13k forks source link

gamespec writeout: 'ascii' codec is used #416

Closed COSdotCOM closed 8 years ago

COSdotCOM commented 8 years ago

What I receive when attempting to set up install files ... thoughts ?

OS: Arch 64bit

INFO [py] Game version(s) detected: Age of Empires 2: The Age of Kings; Age of Empires 2: The Conquerors; Age of Empires 2: The Conquerors, Patch 1.0c
INFO [py] converting metadata
INFO [py] [0] palette
INFO [py] [1] empires.dat
INFO [py] using cached gamespec: /tmp/empires2_x1_p1.dat.pickle
INFO [py] [2] blendomatic.dat
INFO [py] blending masks successfully exported
INFO [py] [3] player color palette
INFO [py] [4] terminal color palette
INFO [py] [5] string resources
INFO [py] [6] writing gamespec csv files
Traceback (most recent call last):
  File "run.py", line 15, in init run (/home/user/Games/openage/SFTtech-openage-3edd2f4/run.cpp:832)
    main()
  File "/home/user/Games/openage/SFTtech-openage-3edd2f4/openage/__main__.py", line 89, in main
    return args.entrypoint(args, cli.error)
  File "/home/user/Games/openage/SFTtech-openage-3edd2f4/openage/game/main.py", line 33, in main
    if not convert_assets(assets, args):
  File "/home/user/Games/openage/SFTtech-openage-3edd2f4/openage/convert/main.py", line 123, in convert_assets
    for current_item in convert(args):
  File "/home/user/Games/openage/SFTtech-openage-3edd2f4/openage/convert/driver.py", line 102, in convert
    yield from convert_metadata(args)
  File "/home/user/Games/openage/SFTtech-openage-3edd2f4/openage/convert/driver.py", line 159, in convert_metadata
    data_formatter.export(args.targetdir, ("csv",))
  File "/home/user/Games/openage/SFTtech-openage-3edd2f4/openage/convert/dataformat/data_formatter.py", line 188, in export
    outfile.write(content)
UnicodeEncodeError: 'ascii' codec can't encode character '\xae' in position 1984: ordinal not in range(128)
TheJJ commented 8 years ago

Is your system configured to use an utf8 encoding? I suspect that you're using LANG=C instead of e.g. LANG=en_US.utf8 or de_DE.utf8, or whatever language you're using.

outfile.write() uses the mode and encoding used when outfile was opened, in mode "w" = write, and this uses your locale set in environment.

inakoll commented 8 years ago

This is definitly related to #408. This is exaclty the kind of error I encountered while my default system encoding wasn't UTF-8. As TheJJ said, verify your default system encoding (LANG environment variable).

COSdotCOM commented 8 years ago

Hmmm it was set for that from the start of this systems creation over 2 years ago. I re checked it and it was reporting correctly, reconfigured it and re-ran locale-gen

All is well now.

Weird

TheJJ commented 8 years ago

Let's continue in #408, and your particular problem is fixed, right?

COSdotCOM commented 8 years ago

Yes this is solved, language was set correctly by had to be reset for some reason