username1565 / uTox_winXP

µTox the lightest and fluffiest Tox client
https://utox.io
Other
6 stars 0 forks source link

Cyrillic pathways not working correctly. #6

Closed username1565 closed 4 years ago

username1565 commented 4 years ago

Overview

  1. uTox version: v0.17.1
  2. Operating system: Windows XP
  3. Desktop Environment/Window Manager (Linux/BSD only): Desktop

Issue

See more tests in this issue: https://github.com/blueclouds8666/uTox_XP/issues/2

Pathways with cyrillic symbls - not working correctly.

  1. Compile uTox.
  2. See uTox.exe in \build folder, after compilation.
  3. Add there msvcr71.dll.
  4. Add there start_portable.bat with code:
    :: Start this in portable-mode: "--portable" or "-p"
    utox.exe --portable --debug
    pause
  5. Now, uTox.exe is portable.
  6. Copy three files uTox.exe, msvcr71.dll, and start_portable.bat into the folder with cyrillic symbols in pathway.
  7. Run start_portable.bat by double click.

See console - errors: WinFilesys: Could not open file: blah-blah uTox: Can not open tox_save.tox to write to it.

  1. Move this three files in the folder without spaces and cyrillic-symbols, like C:\uTox\ Run again start_portable.bat again, wait... See \Tox folder created, and tox_save.tox-file and utox_save.ini-file, inside this folder, was been created too. Restart this, and see only one error:
    WinFilesys:   Could not open file: C:\uTox\Tox\avatars\blahblah-ToxID.png

As you can see, on step 8, uTox.exe can working in the folder without cyrillic symbols in pathway.

If cyrillic-symbols exists in pathway, in this case, \Tox-folder is created, but there is no any files inside this. Maybe, path is not valid encoded.

Also, see this issue: https://github.com/uTox/uTox/issues/1393 and the history of changing /src/windows/filesys.c

P.S.: Anoher test.

  1. create folder with cyrillic symbols in build-folder, like build\блабла\
  2. build uTox.exe
  3. run start_portable.bat
  4. see Tox-folder + (tox_save.tox & tox_save.ini inside) (if no cyrillic symbols in full path of build-folder).
  5. copy 3 files: uTox.exe, msvcr71.dll, and start_portable.bat in the folder with cyrillic symbols.
  6. run start_portable.bat from this folder.
  7. See Tox-folder was been created, tox_save.ini exists inside.
  8. But... tox_save.tox loaded from previous build\Tox-folder, before this folder, with cyrillic symbols. and tox_save.tox is saved in build\Tox, not in build\блабла\Tox.

Maybe, something need to fix for tox_save.tox, because tox_save.ini saved good in build\блабла\Tox, maybe because for this file is loading correct fullpath, and this have correct encoding, but for tox_save.tox, this full-path not loading or encoding is incorrect...

username1565 commented 4 years ago

Yes, here is invalid decoding of pathways with cyrillic symbols, because this pathway not utf8-encoded, this have encoding cp1251, so 1251 need to write instead CP_UTF8, in /src/windows/utf8.c, at this line , to fix the support of cyrillic symbols in pathways, on Windows XP, and maybe, another versions of windows, where cp1251 used by default. Maybe, this can be switched, depending from platform, or by another critery, but I don't know how to do this. So I just write 1251 there, and this is working for me.