[分享] AllowAnywhereRecoding

phpMyAdmin Running Discuss
關於 phpMyAdmin 架設使用操作討論,非本程式相關問題一律砍文!

版主: 版主管理群

回覆文章
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

[分享] AllowAnywhereRecoding

文章 chiouss »

phpMyAdmin 的 config.inc.php 裡面有個選項叫做 AllowAnywhereRecoding,預設這個選項是關閉的 (FALSE),這個選項的用途可以從 Documentation.html 找到。
  • $cfg['DefaultCharset'] string
    Default character set to use for recoding of MySQL queries. This must be enabled and it's described by $cfg['AllowAnywhereRecoding'] option.
    You can give here any character set which is in $cfg['AvailableCharsets'] array and this is just default choice, user can select any of them.
  • $cfg['AllowAnywhereRecoding'] boolean
    Allow character set recoding of MySQL queries. You need recode or iconv support (compiled in or module) in PHP to allow MySQL queries recoding and used language file must have it enabled (by default only these which are in Unicode, just to avoid losing some characters).

    Setting this to TRUE also activates a pull-down menu in the Export page, to choose the character set when exporting a file.
把這個選項打開以後,MySQL 4.1 之前的版本會在首頁多出一個 MySQL charset 的選項,原本的語系選項也會多出各語言的 utf8 語系 (也就是各種語言的 utf8 語系檔啦!)。另外在 Export 這個項目中,各個版本的 MySQL 都會有個下拉選單 Character set of the file,可以選擇把原本資料庫的內容 (ex.UTF-8) 轉成其他編碼方式 (ex. Big5, ISO-8859-1) 輸出。

把這個選項打開之前請先確定你的 PHP 有把 iconv extension 開啟,否則會出現問題。
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

文章 chiouss »

上面那篇沒有提到這個功能的特殊好處,因為那時候我還沒實驗成功 :Q

我在 http://chiouss0817.wordpress.com/2006/0 ... -to-utf-8/ 還有很多文章都說過,要把轉碼錯誤的資料 (big5 被當成 latin1 然後轉成 utf8 寫入) 得靠 mysqldump 來強迫轉出成 latin1。但是很多人都是用免費空間的主機,沒辦法用 mysqldump,所以就這樣 冏

把 AllowAnywhereRecoding 打開之後可以選擇 export sql 成 iso-8859-1,打開來就會看到正常的 Big5 啦!沒辦法用 mysqldump 的網友看到這篇趕快試試看! :D
leon0910
星球普通子民
星球普通子民
文章: 2
註冊時間: 2006-03-20 20:18

文章 leon0910 »

chiouss 寫:上面那篇沒有提到這個功能的特殊好處,因為那時候我還沒實驗成功 :Q

我在 http://chiouss0817.wordpress.com/2006/0 ... -to-utf-8/ 還有很多文章都說過,要把轉碼錯誤的資料 (big5 被當成 latin1 然後轉成 utf8 寫入) 得靠 mysqldump 來強迫轉出成 latin1。但是很多人都是用免費空間的主機,沒辦法用 mysqldump,所以就這樣 冏

把 AllowAnywhereRecoding 打開之後可以選擇 export sql 成 iso-8859-1,打開來就會看到正常的 Big5 啦!沒辦法用 mysqldump 的網友看到這篇趕快試試看! :D
請問一下,在免費空間架站,要如何開啟AllowAnywhereRecoding呢?
是用SQL語法執行 還是直接改config檔呢?
但是用免費空間有方法可以改config檔嗎@@

如果我問的問題已經有人問過,再麻煩提醒我要去哪裡爬文,謝謝^^
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

文章 chiouss »

leon0910 寫:請問一下,在免費空間架站,要如何開啟AllowAnywhereRecoding呢?
是用SQL語法執行 還是直接改config檔呢?
改 config.inc.php
但是用免費空間有方法可以改config檔嗎@@
這個問題我不知道,要問提供你空間的人。如果 phpMyAdmin 是你傳上去的應該沒有理由不能改吧?
jiaruey
星球普通子民
星球普通子民
文章: 6
註冊時間: 2006-08-27 18:17

Re: [分享] AllowAnywhereRecoding

文章 jiaruey »

chiouss 寫: 把這個選項打開之前請先確定你的 PHP 有把 iconv extension 開啟,否則會出現問題。
對不起, 問個小白問題
如何把 PHP 的這個功能開啟?
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

Re: [分享] AllowAnywhereRecoding

文章 chiouss »

jiaruey 寫:
chiouss 寫: 把這個選項打開之前請先確定你的 PHP 有把 iconv extension 開啟,否則會出現問題。
對不起, 問個小白問題
如何把 PHP 的這個功能開啟?
去找你的 php.ini,把 extension = php_iconv.dll 前面的 ; 拿掉,然後 restart Apache
jiaruey
星球普通子民
星球普通子民
文章: 6
註冊時間: 2006-08-27 18:17

Re: [分享] AllowAnywhereRecoding

文章 jiaruey »

chiouss 寫: 去找你的 php.ini,把 extension = php_iconv.dll 前面的 ; 拿掉,然後 restart Apache
謝謝大大, 您的方法已經在自己的機器上測試ok了
但, 在外面的空間雖然可用自己的phpMyAdmin
但還是無法動到 php.ini吧.........@#$%^
chiouss
竹貓忠實會員
竹貓忠實會員
文章: 1741
註冊時間: 2002-11-29 18:19

Re: [分享] AllowAnywhereRecoding

文章 chiouss »

jiaruey 寫:謝謝大大, 您的方法已經在自己的機器上測試ok了
但, 在外面的空間雖然可用自己的phpMyAdmin
但還是無法動到 php.ini吧.........@#$%^
寫信給 web admin 說你需要 iconv extension
回覆文章

回到「phpMyAdmin」