GNOME Bugzilla – Bug 783347
gtkfilechoosernativewin32: Fix support for non-ASCII paths
Last modified: 2017-06-02 11:57:06 UTC
Created attachment 353075 [details] [review] gtkfilechoosernativewin32: Fix support for non-ASCII paths The code used SIGDN_URL to get an URL for the selected item, but Windows URLs are a mix of unicode and percent encoded characters in the locale encoding and not something GFile can understand. The result is a garbage file path. Instead use SIGDN_FILESYSPATH to get a real file path if available. Also checks the return value of g_utf16_to_utf8 because file paths on Windows can contain lone surrogates which would make the conversion fail.
Review of attachment 353075 [details] [review]: Looks good to me.
Thanks!
Small correction: Looks like Windows URLs percent encode the _unicode code points_, no codepage stuff involved. Doesn't affect the fix here..