天天看點

Eclipse 中的亂碼問題

1、重新安裝eclipse,未設定編碼問題,導緻亂碼

2、編碼設定可以在建立項目時設定,也可以在workspace中設定

3、servlet中未設定編碼格式,導緻的亂碼

request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");           

4、jdbc連接配接中的亂碼問題

public String JDBC_URL = "jdbc:mysql://localhost:3306/mi_shop_store?characterEncoding=UTF-8";           

此時需要加上true&

public String JDBC_URL = "jdbc:mysql://localhost:3306/mi_shop_store?true&characterEncoding=UTF-8";           

繼續閱讀