Repository navigation
Fix opening files with Arabic names - #1532
Conversation
|
It is basically working now. Still need to look for places where |
rodolforg
left a comment
There was a problem hiding this comment.
I have no ways to test it because I don't use Windows at home (and I'm in home office due to the pandemic) and I don't have files in other languages like Russian and Arabic etc. :)
But the code seems fine, as long as the filenames are in UTF-8 according to the docs :)
My only concern here is that we increase the Glib dependence in synfig core.
By now, it was limited to GOption* for CLI tool and some remaining Glib::Threads.
Oh well, and some utf8<->locale stuff XD
And FileMonitor – heck that I don't want to handle by ourselves lol
|
@rodolforg agree. |
|
Please don’t merge it yet - I forgot to push one more commit. ^__^ |
|
Should be ready to merge now. ^__^ |
|
Merged. Thank you! |
|
Woops, I forgot to rebase. Sorry! ^__^" |
Closes #1517.
Previously we used
Glib::locale_to_utf8()function, and it worked well for simple encodings (i.e. Russian). But for languages which use wide characters (UTF-16) (i.e. Arabic) this didn't worked. So now we useg_win32_get_command_line()function instead (https://developer.gnome.org/glib/stable/glib-Windows-Compatibility-Functions.html#g-win32-get-command-line).But that was not enough. After adding
g_win32_get_command_line()function the filename was converted properly, but file opening procedure still failingAfter debugging I found that we have to do similar replacement for places where we access filesystem.
The solution is to use Glib's
g_fopen()function instead offopen()- https://people.gnome.org/~ryanl/glib-docs/glib-File-Utilities.html#g-fopen.It is possible we need to use
g_fopen()(and similar Glib's wrappers) in other places...