DokuWiki

It's better when it's simple

使用者工具

網站工具


zh-tw:pagename

差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版前次修改
下次修改
前次修改
最後一次修改 兩邊的下次修訂版
zh-tw:pagename [2011-03-19 16:02] 140.124.3.20zh-tw:pagename [2015-01-20 17:16] 120.127.8.43
行 1: 行 1:
-====== Pagenames ====== +一組
- +
-Pagenames簡單的來說就是wiki中頁面的名稱.在Dokuwiki實際的檔案架構中,Pagenames就是會是那個頁面資料檔的檔案名稱. +
- +
-在[[DokuWiki]]中,Pagenames只可以使用英文字母,數字,以及''.'', ''-'' and ''_''這些特殊符號.其他的特殊符號會被自動轉換成底線"_",而大寫英文字母也會自動被轉換成小寫. +
-至於冒號":"則有特殊用途,它可以產生[[namespaces]]. +
- +
-如果您使用中文命名,它會被轉換成亂碼...orz 其它非英語系字母通常會被轉換,像是"ü" 會變成 "ue".儘管如此,只要Admin在 [[config]] 檔中正確設定 ''localname'',那這些非英語系的字母是被允許的.詳情請參見[[multilanguage]] 頁面 +
-\\ +
-\\ +
-\\ +
-你可以看到完整的Pagename在wiki中任何頁上方.像是你現在應該看到的是''wiki:pagename''+
- +
-當你使用[[InterWiki]]的方法連結至其他的Wiki,那命名就必須符合那些wiki所訂定的規則. +
- +
-即使Admin在 [[config]] 中設定容許使用 [[wp>CamelCase]] ,pagename還是必須要符合前述的命名方法. +
-\\ +
-\\ +
-\\ +
-\\ +
- +
-====== 關於中文頁面名稱亂碼的解決方法 ====== +
- +
-===== 伺服器環境 ===== +
-  * windows XP Profession SP2 +
-  * Apache2.0.54 +
-  * PHP5.0.4 +
-  * PHP加載了mb_string模塊 +
-===== 解決辦法 ===== +
-這是一個不成熟的辦法,在分別測試了PmWiki與DokuWiki後,覺得DokuWiki很不錯。 +
-特別是它的存儲文本文件,直接打開也是清晰可讀的。 +
- +
-比較遺憾的是,文件名是亂碼((其實不是亂碼,是進行了urlencode編碼,我們看不懂而已)),為了解決這個問題, +
-對\inc\utf8.php做以下就可以了,經過初步測試沒有問題: +
- +
-  * 修改對文件名進行編碼、解碼的兩個函數:utf8_encodeFN、utf8_decodeFN +
- +
-<code php> +
-function utf8_encodeFN($file,$safe=true){ +
-  if($safe && preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){ +
-    return $file; +
-  } +
-/*我註釋掉的部分 +
-  $file = urlencode($file); +
-  $file = str_replace('%2F','/',$file);*/ +
-//我增加的部分開始 +
-  $file=mb_convert_encoding($file,"CP950","UTF-8"); +
-//我增加的部分結束  +
-  return $file; +
-+
- +
-function utf8_decodeFN($file){ +
-/* 我註釋掉的部分  +
-$file = urldecode($file);*/ +
-//我增加的部分開始 +
-  if(preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){ +
-    return $file; +
-  } +
-  $file=mb_convert_encoding($file,"UTF-8","CP950"); +
-//我增加的部分結束 +
-  return $file; +
-+
-</code> +
- +
-  * 對於不同的內碼,將"CP950"換成對應的代碼即可。 +
-  * CP936是簡體中文、CP950是繁體中文 +
-這樣所有的中文連結都將以正確的中文文件名儲存了。 +
- +
-===== BUG與缺點 ===== +
-目前知道的不足有以下一些: +
-  - 需要mb_string模塊支援; +
-  - 對文件名進行了編碼轉換,估計會影響運行的效率((不過對於我這種個人用戶來講,影響不大)); +
-  - 當更換作業系統時,還需要增加內容,對文件名進行mb_detect_encoding處理; +
-  - 會和Tag plugin的index功能衝突,產生亂碼的index +
-\\ +
-\\ +
- +
-====== 關於中文頁面名亂碼的解決辦法2 ====== +
-===== 伺服器環境 ===== +
-  * windows XP Profession SP2 +
-  * IIS +
-  * PHP4 +
-===== 解決辦法 ===== +
-小弟受上面這位大哥的啟發,作了一下改進,現在可以不用mb_string模塊的支援了。經過初步測試沒有問題:\\ +
- --- //[[jflycn@gmail.com|慕容飛宇]] 2006-04-14 07:15// +
- +
-  * 需要從[[http://www.phpe.net/class/95.shtml]]下載Encoding類,解壓後放到dokuwiki的inc目錄下的encoding目錄中。 +
-  * 將encoding目錄中的encoding.inc.php文件中的「var $FilePath」修改為encoding類的完整路徑; +
-  * 對inc目錄下的utf8.php中的函數utf8_encodeFN和utf8_decodeFN作如下修改: +
-<code php> +
-require_once(DOKU_INC.'inc\encoding\encoding.inc.php'); +
- +
-function utf8_encodeFN($file,$safe=true){ +
-  if($safe && preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){ +
-    return $file; +
-  } +
-/*我註釋掉的部分 +
-  $file = urlencode($file); +
-  $file = str_replace('%2F','/',$file);*/ +
-//我增加的部分開始 +
- $CharEncoding=new Encoding();  +
- $CharEncoding->SetGetEncoding("UTF-8")||die("編碼名錯誤");  +
- $CharEncoding->SetToEncoding("GBK")||die("編碼名錯誤");  +
- $file=$CharEncoding->EncodeString($file);  +
-//我增加的部分結束  +
-  return $file; +
-+
- +
-function utf8_decodeFN($file){ +
-/* 我註釋掉的部分  +
-$file = urldecode($file);*/ +
-//我增加的部分開始 +
-  if(preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){ +
-    return $file; +
-  } +
- $CharEncoding=new Encoding();  +
- $CharEncoding->SetGetEncoding("GBK")||die("編碼名錯誤");  +
- $CharEncoding->SetToEncoding("UTF-8")||die("編碼名錯誤");  +
- $file=$CharEncoding->EncodeString($file);  +
-//我增加的部分結束 +
-  return $file; +
-+
-</code> +
- +
-這樣所有的中文連結都將以正確的中文文件名存儲了。 +
-\\ +
-\\ +
-大家有問題可以到[[discussion:chineseuserdiscussion|中文用戶討論]]討論解決問題。 +
----- +
- +
-====== 關於中文頁面名亂碼的解決辦法-之Windows下亂碼 ====== +
-===== 伺服器環境 ===== +
-  * windows Server 2008R2 +
-  * Apache 2.2 +
-  * PHP 5 +
-  * dokuwiki-2010-11-07a.tgz “Anteater” +
- +
-新版本可以直接設定編碼是UTF-8, safe或url (請參考[[http://www.dokuwiki.org/config:fnencode|config:fnencode]]) +
- +
-但是windows還是使用big5作為目錄與檔名的編碼 +
-如是在windows下,這三種方法還是得到亂碼 +
- +
-我作了以下的修改可以正常的運作 +
- +
-1.conf/local.php +
-修改$conf['fnencode'] = 'big5'; +
- +
-2.inc/pageutils.php +
-<code php> +
-function utf8_encodeFN($file,$safe=true){ +
-    global $conf; +
-    ...略 +
- +
-    if($conf['fnencode'] == 'safe'){ +
-        return SafeFN::encode($file); +
-    } +
- +
-    //新增以下這段 +
-    if($conf['fnencode'] == 'big5'){ +
-        return mb_convert_encoding($file,'big5','UTF-8'); +
-    } +
-    //到這 +
- +
-    $file = urlencode($file); +
-    $file = str_replace('%2F','/',$file); +
-    return $file; +
-+
-... +
-function utf8_decodeFN($file){ +
-    global $conf; +
-    if($conf['fnencode'] == 'utf-8') return $file; +
- +
-    if($conf['fnencode'] == 'safe'){ +
-        return SafeFN::decode($file); +
-    } +
-     +
-    //新增以下這段 +
-    if($conf['fnencode'] == 'big5'){ +
-        return mb_convert_encoding($file,'UTF-8','big5'); +
-    } +
-    //到這 +
- +
-    return urldecode($file); +
- return $file; +
-+
-</code> +
-提供給大家參考 +
----- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
-本頁面授權方式為[[http://creativecommons.org/licenses/by-nc-sa/2.0/|Creative Commons Attribution-NonCommercial-ShareAlike License Version 2.0. ]] +
zh-tw/pagename.txt · 上一次變更: 2015-01-21 01:44 由 ach

若無特別註明,本 wiki 上的內容都是採用以下授權方式: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki