Here is what I got –
String before encoding it in Java – D:\Net\S\English\ALL HITS ! NO WORDS !\All That She Wants….Ace Of Base.mp3
String after encoding in Java (Using URLEncoder.encode(text,”UTF-8″) function) – D%3A%5CNet%5CS%5CEnglish%5CALL+HITS+%21+NO+WORDS+%21%5CAll+That+She+Wants….Ace+Of+Base.mp3
So if you try decode a UTF-8 string encoded in Java, “+” sign still remains.
So here is what I did in order to decode the string properly –
I replaced all the “+” sign appearances in string using regular expression inside the replace function. Similar things happen with other characters like “&” etc.
text = decodeURIComponent(text);
text = text.replace(/\+/g,” “);