[問題] 如何判別搜尋字串並轉為utf-8?

看板Web_Design作者 (Null)時間19年前 (2006/07/24 19:53), 編輯推噓3(301)
留言4則, 3人參與, 最新討論串1/1
http://vision.csie.ncku.edu.tw/~mj23gto/web/tintinblog.php?module=piano_sheet 這是我的網站 可以搜尋關鍵字 來搜尋琴譜 有一個問題蠻奇怪的是 當我在 search box裡面打入 "四手聯彈" 按搜尋的時候 網址顯示的是 http://vision.csie.ncku.edu.tw/~mj23gto/web/tintinblog.php?pgnum=1&word= %3F%9B%E6%3F%3F%AF%E5%3F&DB_upload=on&DB_root=on&hidden=1&module=piano_sheet 但是如果是利用 複製貼上 (先用滑鼠標選網頁上的文字 再貼到search box裡面) 按搜尋的時候 就會變成 http://vision.csie.ncku.edu.tw/~mj23gto/web/tintinblog.php?pgnum=1&word=四手聯彈 &DB_upload=on&DB_root=on&hidden=1&module=piano_sheet 我用的是PHP 傳進去的參數是 $word 關鍵字用打的就變成utf-8 關鍵字用貼的就變成big5 有什麼方法可以自動偵測 並且變成utf-8呢? 感謝各位的回答... -- 歡迎光臨我的個人鋼琴音樂網站 喜歡鋼琴的你千萬別錯過! Justin's Piano Worlk http://tintin.asialife.com.tw -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.246.49 ※ 編輯: mj23gto 來自: 140.116.246.49 (07/24 20:04)

07/24 20:08, , 1F
mb_detect_encoding()
07/24 20:08, 1F

07/24 20:11, , 2F
urlencode()
07/24 20:11, 2F

07/26 18:26, , 3F
哈哈 你的網頁我常逛 沒想到你也是鄉民!! XD
07/26 18:26, 3F

07/27 10:08, , 4F
網站需要多人協助開發 歡迎有志者給予意見:)
07/27 10:08, 4F
文章代碼(AID): #14nBIzLJ (Web_Design)