1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-27 19:30:27 +00:00
ympd/htdocs
Virgil Dupras fe44fca184 Fix browsing for non-ascii entity URI under Safari
Previously, browsing entities with non-ascii characters in their URI
under Safari wouldn't work. Directories would be empty, songs wouldn't
be added. I haven't tried it, but this behavior seems to be common to
Webkit-based browsers, so Chrome would be affected too.

This turned out to be because Safari normalizes all unicode strings to
NFC, breaking the link with MPD-spewed URIs, which are in NFD.

An obvious fix would have been to normalize all URIs to NFD, but
unfortunately, Safari doesn't have `str.normalize()`. Adding
normalization capabilities to our JS side would have involved
introductiing libraries such as `unorm`, which is rather big.

We could have done it on the C side, but it involves introducing `icu`,
which is far from trivial too.

After much fussing around, I stumbled on a simple solution: URI-encode
our URI when creating our browser table row. This magically prevents
Safari from trying to mess with our unicode form before we get the
chance to send it back to our server.
2015-06-20 22:39:42 -04:00
..
assets fixed firefox websocket bug, added assets 2013-12-03 21:48:49 +01:00
css replaces libwebsockets with mongoose, changed licese to gpl 2014-03-08 12:30:49 +01:00
fonts Initial commit 2013-11-04 18:18:38 +01:00
js Fix browsing for non-ascii entity URI under Safari 2015-06-20 22:39:42 -04:00
index.html webpage: remove respond.js 2015-05-01 17:06:57 -04:00