In PHP:
php -r "echo urlencode('["IM"]'); "
The result is %5BIM%5D
But in java
String text = URLEncoder.encode('["IM"]',"UTF-8");
System.out.println("text" + text);
The result is text%5B%22IM%22%5D
What's the different between these two functions? How can I implement a java code to complete the same function of php?
String text = URLEncoder.encode('[IM]',"UTF-8");
System.out.println("text" + text);
gives %5BIM%5D
echo urlencode('["IM"]');
gives %5B%22IM%22%5D
echo urlencode('[IM]');
gives %5BIM%5D
echo urlencode('[\"IM\"]');
gives %5B%5C%22IM%5C%22%5D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With