Re: German "Umlaute" in drag and drop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello infirit,

that simply worked, glib and g_uri_unescape_string() did the trick.
I even ended up using less code as before as with my "hacked together" custom solution.

Thank you very much for giving the right direction!
Its very helpful.

I havent looked into Glib that much at present, perhaps I am advised to do so and safe myself some headaches in the future.


Jan


On 09.01.2017 01:18, infirit wrote:
Op 01/09/2017 om 12:33 AM schreef Jan:
<snip>
I have a file chooser dialog in my application, which does open/access
the files perfectly, even with the "Umlauts" (äöü) and all function
handling the work, work as expected.

Only when the same file becomes dragged and dropped, the special
symbols are mixed up.

They are not mixed up but a correct uri with unicode characters escaped
as per spec [1].


From drag and drop I receive:

file:///home/jan/Schreibtisch/S%C3%A4chsische%20Zeitung.pdf

This is correct.


Instead of:
file:///home/jan/Schreibtisch/Sächsische Zeitung.pdf
<snip>
And is then processed to remove the "%20" characters which works fine.

Don't do this, see below how to unescape the uri.


But I haven't found a way how to get the variant which displays the
path like I desire with Umlauts.

Perhaps this is more of a C question, but perhaps someone has a
insight in case the problem comes from GTK3 and not C itself.

Its your misunderstanding of a uri, see [1].


I tried writing a variant which replaces the writing form with the
correct Umlaut symbol, but it just shows me a messed up filename.


If you plan to do further processing or monitoring of the file you may
want to look at a glib GFile [2] and use g_file_new_for_uri which will
transparently unescape for you. If you just want to unescape the uri use
g_uri_unescape_string [3].

~infirit

[1] https://en.wikipedia.org/wiki/File_URI_scheme
[2] https://developer.gnome.org/gio/2.50/GFile.html
[3]
https://developer.gnome.org/glib/stable/glib-URI-Functions.html#g-uri-unescape-string


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux