問題:
I am expecting我期待
System.out.println(java.net.URLEncoder.encode("Hello World", "UTF-8"));
to output:輸出:
Hello%20World
(20 is ASCII Hex code for space) (20 是空格的 ASCII 十六進制代碼)
However, what I get is:但是,我得到的是:
Hello+World
Am I using the wrong method?我使用了錯誤的方法嗎? What is the correct method I should be using?我應該使用的正確方法是什麼?
解決方案:
參考一: https://en.stackoom.com/question/JsWn參考二: https://stackoom.com/question/JsWn