This patch adds basic Korean support to version 1.4.5
Files:
--- pukiwiki.ini.php.bak Mon Feb 7 22:22:40 2005 +++ pukiwiki.ini.php Tue Feb 22 17:11:44 2005 @@ -33,7 +33,7 @@ ///////////////////////////////////////////////// // Language / Encoding settings -// LANG - Internal content encoding ('en', 'ja', or ...) +// LANG - Internal content encoding ('en', 'ja', 'ko', or ...) define('LANG', 'ja'); // UI_LANG - Content Language for buttons, menus, etc @@ -75,6 +75,10 @@ switch (LANG) { // or specifiy one case 'ja': define('ZONE', 'JST'); + define('ZONETIME', 9 * 3600); // JST = GMT + 9 + break; +case 'ko': + define('ZONE', 'KST'); define('ZONETIME', 9 * 3600); // JST = GMT + 9 break; default :
--- orig/lib/init.php Tue Feb 22 02:25:59 2005 +++ lib/init.php Tue Feb 22 09:31:39 2005 @@ -68,6 +68,11 @@ define('MB_LANGUAGE', 'Japanese'); define('SOURCE_ENCODING', 'EUC-JP'); break; +case 'ko': // UTF-8 + define('CONTENT_CHARSET', 'UTF-8'); + define('MB_LANGUAGE', 'Korean'); + define('SOURCE_ENCODING', 'UTF-8'); + break; default:
--- orig/lib/pukiwiki.php Sun Oct 10 21:58:30 2004 +++ lib/pukiwiki.php Tue Feb 22 15:18:58 2005 @@ -67,6 +67,8 @@ // 初期化: 設定ファイルの読み込み require(LIB_DIR . 'init.php'); +if (LANG == 'ko') require(LIB_DIR . 'hangul.php'); + ///////////////////////////////////////////////// // Main
--- orig/lib/func.utf8.php Tue Feb 22 13:12:13 2005 +++ lib/func.php Tue Feb 22 12:25:35 2005 @@ -275,7 +275,10 @@ // ソートキーを決定する。 ' ' < '[a-zA-Z]' < 'zz'という前提。 $symbol = ' '; - $other = 'zz'; + if (LANG == 'ko') + $other = '힣'; + else + $other = 'zz'; $retval = ''; @@ -313,8 +316,14 @@ $head = $other; } } else { - $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : - (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other); + if (LANG == 'ko') + $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : + (preg_match('/^([ -~])/', $page, $matches) ? $symbol : + (preg_match('/^([가-힣])/u', $page, $matches)) ? hangul_chosung($page) : + $other); + else + $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : + (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other); } $list[$head][$page] = $str;
Note, 가 and 힣 is UTF-8 character of html entity number 44032 and 55203
--- orig/lib/trackback.php Sat Jan 29 22:53:37 2005 +++ lib/trackback.php Tue Feb 22 13:16:48 2005 @@ -112,6 +112,11 @@ 'charset' => SOURCE_ENCODING // Ping text encoding (Not defined) ); + if (LANG == 'ko') { + mb_convert_variables('EUC-KR', SOURCE_ENCODING, $putdata); + $putdata['charset'] = 'EUC-KR'; + } + foreach ($links as $link) { $tb_id = tb_get_url($link); // Get Trackback ID from the URL if (empty($tb_id)) continue; // Trackback is not supported
Majority of Korean blogs use EUC-KR and some of them does not converts UTF-8 TrackBack Pings to EUC-KR(which results garbages in TrackBack), but most UTF-8 blogs understands EUC-KR Ping, so we should send it in EUC-KR.
You can get translated WikiSeed from PukiWikiKr.
번역된 위키시드(문법등)가 필요한 한국분은 PukiWikiKr [[홈페이지>http://kldp.net/projects/pukiwikikr]]에서 얻으실 수 있습니다.