Closed nick1n closed 11 years ago
Do we need to use htmlescapeentities() or something?
Looks like I just need to use encodeURI but I thought I was, maybe I'm not using it correctly.
Do you have a commit # I could look at?
No, its always has been in there, just open app.js and search for encodeURI
hmm it seems that encodeURI doesn't encode + and / characters and maybe even a few others might need to use something else or have special cases for those
Yea, it looks like I'll just have to use encodeURIComponent instead of encodeURI
Looking into even more, it looks like even encodeURIComponent won't catch everything, source: http://stackoverflow.com/questions/332872/how-to-encode-a-url-in-javascript So, will probably have to create a helper function to do it properly.
Ok, it looks like last.fm is encoding some special characters, such as +, twice for their urls. So, a + will be encoded as %252B, %25 is the encoded value for %, making it decode(%252B) = %2B and %2B is the encoded value for +. Now just need to figure out which other special characters last.fm does this for :)
Going to close this for now, hopefully spaces and pluses are the only special cases for last.fm links.
special characters such as + and /