[Java] 網址有中文字,錯誤400怎辦?

網址有中文字的話,網頁會拋出錯誤400的畫面

這時只要做轉碼,就可以解決
URLEncoder.encode("中文字", "UTF-8");

例如:
String apiParm = URLEncoder.encode("我", "UTF-8");

留言

這個網誌中的熱門文章

[日文] Google日文輸入法 簡單安裝說明

[面試] 日月光 設備工程師

[Windows] 還我 win7 相片檢視器!!