Branch: refs/heads/master
  Home:   https://github.com/synfig/synfig
  Commit: 69dc1f7b9f06ba36273c393eebc29214e46a3e46
      
https://github.com/synfig/synfig/commit/69dc1f7b9f06ba36273c393eebc29214e46a3e46
  Author: ice0 <konop...@gmail.com>
  Date:   2022-06-23 (Thu, 23 Jun 2022)

  Changed paths:
    M synfig-core/src/synfig/debug/log.cpp
    M synfig-core/src/synfig/filesystem.cpp
    M synfig-core/src/synfig/filesystem.h
    M synfig-core/src/synfig/main.cpp
    M synfig-studio/src/gui/app.cpp
    M synfig-studio/src/gui/duckmatic.cpp
    M synfig-studio/src/gui/workspacehandler.cpp
    M synfig-studio/src/synfigapp/main.cpp
    M synfig-studio/src/synfigapp/settings.cpp

  Log Message:
  -----------
  fix: Synfig does not start if the OS username contains non-Latin characters 
(Windows) (#2650)

* Fixed a bug due to which Synfig does not start if the username contains 
non-Latin characters (Windows)

Finally, I found a proper solution for the problem with file paths
containing non-Latin characters in Windows.

The main problem was that we are working with UTF-8, while on Windows
filenames use UTF-16. To work with files, we use the Glibmm wrapper,
which performs correct path conversion, but in some cases we need
standard cpp `std::fstream` objects.

Unfortunately, the standard implementation does not support `std::wstring`
paths. C++17 introduced support through the use of `std::filesystem::path`,
but since we continue to support c++11, this option is not suitable for us.

Luckily, both MSVC and MinGW support a non-standard constructor overload
using wchar_t, and on Windows we can use it. All that is required is to convert
the path to UTF-16 for Windows and leave it as is for other operating systems.

For this, a special method `FileSystemNative::path(...)` has been added, which
does all the necessary work of converting the path when necessary.




_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to