[Android] Clarification on '#' breaking filename URIs in m3u playlists (you might already know)

juliank at i2pmail.org juliank at i2pmail.org
Thu Jul 23 21:08:16 CEST 2020


The '#' characters may not be starting a comment but are likely being withheld in the same way browsers withhold sending the anchor that a person wishes to jump to on a webpage.

Eg.
www.company.com/about#heading-to-jump-to

I'm not an expert on how you might fix this but maybe a recursive function that splits a string by the first '#' it finds and returns a urlEncoded version of whatever appears on each side of a '#' character? When no '#' is found it just returns a urlEncoded version as normal?

Maybe do a pregmatch first and if after the last '#' there is no '.[a-z]+' to suggest a filetype then you can actually drop it and everything after it? I admit that I'm now thinking of a bizarre use-case where someone wants to specify a range they want to listen to after a '#'.

Eg. I have a rock m3u playlist with an entry...
'Hour-long podcast featuring a pop, rock and jazz artist.ogg#21m34s987msTo38m08s200ms'

You may ignore this last thought experiment but I'm slightly aroused by it, I can't lie.



More information about the Android mailing list