Vezzra wrote:
Code:
19:15:50.633145 [error] AI : AI Config: default file is not present and not writable at location C:\Users\Benjamin Schäfer\AppData\Roaming\FreeOrion\AI\default\config.ini
2016-09-24
If you take a look into the stack trace you will see:
Code:
C:\\Users\\Benjamin Sch\xc3\xa4fer\\AppData\\Roaming\\FreeOrion\\config.ini
That means the string data IS utf-8 encoded (\xc1\xa4 is the byte sequence of an utf-8 encoded ä) but is not recognized as a python unicode string but handed over as, well, Python terminology calls it string but it's just a byte sequence with no determined encoding. Problem here is that windows uses utf-16le as file path encoding where the ä is represented by \x00\xe4 so there is no match between those pathes when comparing them as dumb byte sequences. This problem doesn't occur on Mac or Linux because the file pathes are dumb byte sequences that happen to be encoded as utf-8.
The python open function determines if the path should be handed over to the operating system as dumb byte sequence or converted to the native filesystem encoding by passing either a python unicode string or a regular python string as path. We do the latter and should do the former. So adding something like
Code:
f = open(unicode(path, 'utf-8'), 'r') // convert path to a unicode object and
should do the trick for now.