Pagenames簡單的來說就是wiki中頁面的名稱.在Dokuwiki實際的檔案架構中,Pagenames就是會是那個頁面資料檔的檔案名稱.
在DokuWiki中,Pagenames只可以使用英文字母,數字,以及., - and _這些特殊符號.其他的特殊符號會被自動轉換成底線”_”,而大寫英文字母也會自動被轉換成小寫.
至於冒號”:“則有特殊用途,它可以產生namespaces.
如果您使用中文命名,它會被轉換成亂碼…orz 其它非英語系字母通常會被轉換,像是”ü” 會變成 “ue”.儘管如此,只要Admin在 config 檔中正確設定 localname,那這些非英語系的字母是被勻許的.詳情請參見multilanguage 頁面
你可以看到完整的Pagename在wiki中任何一頁上方.像是你現在應該看到的是wiki:pagename.
當你使用InterWiki的方法連結至其他的Wiki,那命名就必須符合那些wiki所訂定的規則.
這是一個不成熟的辦法,在分別測試了PmWiki與DokuWiki後,覺得DokuWiki很不錯。 特別是它的存儲文本文件,直接打開也是清晰可讀的。
比較遺憾的是,文件名是亂碼1),為了解決這個問題, 對\inc\utf8.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,"CP936","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","CP936"); //我增加的部分結束 return $file; }
這樣所有的中文連結都將以正確的中文文件名存儲了。
目前知道的不足有以下一些:
小弟受上面這位大哥的啟發,作了一下改進,現在可以不用mb_string模塊的支援了。經過初步測試沒有問題:
— 慕容飛宇 2006-04-14 07:15
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; }
這樣所有的中文連結都將以正確的中文文件名存儲了。
大家有問題可以到中文用戶討論組討論解決問題。
本頁面授權方式為Creative Commons Attribution-NonCommercial-ShareAlike License Version 2.0.
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported