URI encoding square brackets
Hi,
RFC 3986 says that square brackets are now only for IPv6 literals. Some libraries have updated to encode them, some haven't. I found that URIs in an XSPF playlist with square brackets (probably) aren't being decoded properly. I don't know if this happens anywhere else in the app.
For example:
"Music/Albums/Blur/Tender%20%5BSingle[#1](https://code.videolan.org/videolan/vlc/-/issues/1)%5D/01%20Tender.m4a"
is URI and XML encoded for:
"Music/Albums/Blur/Tender [Single#]/01 Tender.m4a"
Note that [ is encoded as %5B and ] as %5D. Different libraries handle this differently, as these examples from Ruby show:
require 'uri'
# false
URI.escape "Music/Albums/Blur/Tender [Single#]/01 Tender.m4a"
# "Music/Albums/Blur/Tender%20[Single%23]/01%20Tender.m4a"
require 'addressable/uri'
# true
Addressable::URI.escape "Music/Albums/Blur/Tender [Single#]/01 Tender.m4a"
# "Music/Albums/Blur/Tender%20%5BSingle#%5D/01%20Tender.m4a"
People will keep putting special characters anywhere you let them! :)
Regards, iain