[問題] web顯示亂碼

看板Web_Design作者 (阿U)時間13年前 (2013/01/25 15:28), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串1/1
我是用eclipse開發jsp的 eclipse端已經google過 能設定成utf-8的都已經設定了 jsp檔案也有設定一些編碼 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 而且我頁面還放到nopad++先轉成utf8在複製回去 還是一樣 然後開啟網頁後就變成 http://ppt.cc/E7k3 我在接收post的jsp頁面先設定 <%request.setCharacterEncoding("UTF-8"); %> 然後印出來頁面上又可以變成中文 但是存到mysql資料庫後又變成 ??? 的亂碼 有google到可以設定fliter 但是要有用spring的framework才行 請問有人可以幫我解決嗎? 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.168.194.247

01/25 15:42, , 1F
你要設定mysql的編碼....
01/25 15:42, 1F
已經有確定MYSQL編碼是UTF-8了 ※ 編輯: sing10407 來自: 1.168.194.247 (01/25 15:49)

01/25 16:30, , 2F
對mysql的連線字串有指定utf8編碼嗎?
01/25 16:30, 2F
解決了 在jdbc連線加這段 jdbc:mysql://localhost:3306/db_cnjsp?useUnicode=true&characterEncoding=utf8 ※ 編輯: sing10407 來自: 1.168.194.247 (01/25 16:39)

01/27 00:58, , 3F
mysql是utf8編碼,連線encoding是big5卻正常了?why?
01/27 00:58, 3F
連線字串打錯了 是utf8 已修正 ※ 編輯: sing10407 來自: 1.168.194.247 (01/27 18:06)
文章代碼(AID): #1H0ZGL2x (Web_Design)