drobilla / serd

A lightweight C library for RDF syntax
https://gitlab.com/drobilla/serd
ISC License
86 stars 15 forks source link

Handle hexdigits when unescaping uris #4

Closed johannes-mueller closed 6 years ago

johannes-mueller commented 7 years ago

serd_node_new_file() escapes !is_uri_path_char() characters to %XX where XX is a pair of hexdigits. Thus serd_file_uri_parse() also has to unescape %XX properly.

This is crucial, if non-ascii unicode chars are in the URI, which is the case when for example somewhere in the session path of an Ardour session a !(is_digit() || is_alpha()) character occurs.

The introduced is_hexdig() function does not tolerate small "a-f" letters as hex digits, because RFC2234 does not mention them as being allowed in a hexdig.

Topic has been discussed in #ardour with @x42.

drobilla commented 6 years ago

Awesome, thanks.

The fix needed cleanup, so I cherry-picked and revised that commit. I dropped the test one and cleaned up the previous mess that was there to more rigorously test round-ripping of paths with escapes with far less code.

drobilla commented 6 years ago

Release time. Can you confirm the latest version fixes the visible issue in Ardour? @johannes-mueller @x42

x42 commented 6 years ago

You can ask on #ardour IRC or the mailinglist. Ardour Nightlies use serd 6b9074f since July/15th

johannes-mueller commented 6 years ago

I can confirm it fixes the visible issue in ardour 5.10-277-g8c6d78c18 linked against serd 6b9074f.

drobilla commented 6 years ago

Great, thanks.