I think its depreciated but doing this to the encoded string worked for me:
str = java.net.URLEncoder.encode(str , "UTF-8");
I think its depreciated but doing this to the encoded string worked for me:
str = java.net.URLEncoder.encode(str , "UTF-8");