以下内容为根据英文的[[..pagename]]翻译并修改得到。
====== 页面名 ======
[[DokuWiki]]中页面名(pagename)的英文字母被自动转换成小写。
如果设定了DokuWiki的''localname'',那么,是可以采用非英语系的字母作为页面名的。详情请参见[[:Localization]] 。这时候,中文命名会被转换成特定编码,其它非英语系字母页面名也会被转换成特定编码。
你可以看到完整的Pagename在wiki中任何一页上方.像是你现在应该看到的是''wiki:pagename''.
当你使用[[..InterWiki]]的方法连结至其它的Wiki,那命名就必须符合那些wiki所订定的规则.
即使管理员设定允许使用 [[wp>CamelCase]] ,pagename还是必须要符合前述的命名方法。
===== 页面名和命名空间 =====
你可以将命名空间描述成文件夹,页面名描述成其中的文件。
因此,页面名''a:b:c'' 可描述为:
根级命名空间 (总是存在的)
|
+-- 'a' 命名空间
|
+-- 'b' 命名空间
|
+-- 'c' 页面名
要注意,命名空间与页面名可以相同。例如,在上面的例子中,页面名''a:b'' 可描述成:
根级命名空间 (总是存在的)
|
+-- 'a' 命名空间
|
+-- 'b' 页面名 (不要与上面提到的命名空间 'b'混淆)
===== 创建页面名 =====
当浏览器请求一个尚不存在的页面名之时,DokuWiki会给你提供选项让你创建它(这取决于你的访问权限)。你可以在另一个DokuWiki页面中创建一个链接,然后让浏览器访问该链接,从而创建新的页面。
如果你的页面名中包含不存在的页面空间,那么,该页面空间也会被自动创建。
===== 删除页面名 =====
如果你编辑一个页面名并移除其中的所有内容,那么,DokuWiki会删除该页面。
===== 解决中文文件名乱码问题 =====
===== 伺服器環境 =====
* MacOSX Snow Leopard 10.6.2
* Apache2.0.54
* PHP5.3.1
=====================
经过分析,Dokuwiki是把文件名通过url_encode();之后再存储的...
另外两种方法参看这里:
http://www.dokuwiki.org/zh-tw:pagename?do=show
file: "\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);
*/
return $file;
}
}
if(!function_exists('utf8_decodeFN')){
/**
* URL-Decode a filename
*
* This is just a wrapper around urldecode
*
* @author Andreas Gohr
* @see urldecode
*/
function utf8_decodeFN($file){
//$file = urldecode($file); //再注释掉这个语句...
return $file;
}
}
//同样,
这样,文件名在我的系统上是正常显示了,不知道其他系统如何...
====== Windows XP下采用UTF-8格式文件名乱码解决方法 ======
* WinXP SP3
* Apache2.2.8
* PHP5.2.6
=====================
修改\inc\pageutils.php中utf8_encodeFN、utf8_decodeFN两个函数
以下是我的修改
function utf8_encodeFN($file,$safe=true){
global $conf;
if($conf['fnencode'] == 'utf-8') {
$file=mb_convert_encoding($file,"CP936","UTF-8");
return $file;}
if($safe && preg_match('#^[a-zA-Z0-9/_\-\.%]+$#',$file)){
return $file;
}
if($conf['fnencode'] == 'safe'){
return SafeFN::encode($file);
}
$file = urlencode($file);
$file = str_replace('%2F','/',$file);
return $file;
}
function utf8_decodeFN($file){
global $conf;
if($conf['fnencode'] == 'utf-8') {
$file=mb_convert_encoding($file,"UTF-8","CP936");
return $file;}
if($conf['fnencode'] == 'safe'){
return SafeFN::decode($file);
}
return urldecode($file);
}