colobot / colobot

Source code of open-source Colobot: Gold Edition project developed by Epsitec and TerranovaTeam
http://colobot.info/
GNU General Public License v3.0
1.11k stars 189 forks source link

Can't handle non-Latin characters in paths #922

Open Anton-V-K opened 7 years ago

Anton-V-K commented 7 years ago

There is a crash when starting colobot 0.19 for the user (without administrator privileges) which have non-Latin (f.i., Cyrillic) characters in its home directory (%APPDATA%) on Windows. Apparently the application can't handle non-Latin characters in some paths. If such user has administrator privileges a new directory is created to keep colobot settings, but it has queer name (like C:\Users\Администратор\colobot instead of C:\Users\Администратор\colobot).

Anton-V-K commented 7 years ago

This issue happens only with some paths. For instance, the path to log.txt doesn't support non-Latin characters. In the same time the paths to colobot.ini and savegame do support non-Latin characters, so the fix will have limited scope. I guess, to save log.txt in the proper location the fix should rely on CSystemUtilsWindows::UTF8_Decode (as in other places) and be applied in main.

MikhailChe commented 6 years ago

Jsut an obervation. The problem still exists in master 0.1.11-alpha for Windows x64 (the one at colobot.info), but seems to be fixed in dev (at https://compiled.colobot.info/). I'll investigate further and provide you with the details when I have more time. msvcpprtimelib

Anton-V-K commented 5 years ago

The problem still happens with 0.1.12 alpha (on Windows 7 x64 SP1) :(

Anton-V-K commented 2 years ago

The problem still happens with 0.2.0-alpha on Windows 7 SP1 64-bit.