I'm creating a web-playlist with Amplitude.js, and am having problems generating the urls for some of the song files. Specifically, when I try to encode a string with the '「 ' and '」' characters, it does not return the correct url. When I manually inspect the file in my local directory, it says this is the url:
'/data/album0/04%20「%20P%20H%20Y%20S%20A%20」-%20w0nd3rful.mp3'
^Screen shot of address when I open the .mp3 file in my directory (browser: google chrome)
How do I get the correct encoding and what accounts for this discrepancy?
let songToGet = 'data/album0/04 「 P H Y S A 」- w0nd3rful.mp3'
let encoded = encodeURI(songToGet)
let decoded = decodeURI(encoded)
console.log(decoded === songToGet)