From: sakamocchi Date: Wed, 19 Jan 2011 08:32:30 +0000 (+0000) Subject: Include UTF-8 multibyte processing. X-Git-Tag: release-3-64~97 X-Git-Url: http://git.sourceforge.jp/view?p=nucleus-jp%2Fnucleus-jp-ancient.git;a=commitdiff_plain;h=85bc3d8d758003b34ec9aa57619b5929c1a90356 Include UTF-8 multibyte processing. git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1092 1ca29b6e-896d-4ea0-84a5-967f57386b96 --- diff --git a/utf8/nucleus/xmlrpc/server.php b/utf8/nucleus/xmlrpc/server.php index 0266c09..e1c71a0 100755 --- a/utf8/nucleus/xmlrpc/server.php +++ b/utf8/nucleus/xmlrpc/server.php @@ -73,7 +73,8 @@ include_libs('xmlrpc.inc.php',false,false); include_libs('xmlrpcs.inc.php',false,false); /* define xmlrpc settings */ -$xmlrpc_internalencoding = _CHARSET; +//$xmlrpc_internalencoding = _CHARSET; +$xmlrpc_internalencoding = 'UTF-8'; $xmlrpc_defencoding = 'UTF-8'; /* definition of available methods */ @@ -133,6 +134,12 @@ function _addDatedItem($blogid, $username, $password, $title, $body, $more, $pub if ($closed != 1) $closed = 0; + if (strtolower(_CHARSET) != 'utf-8') { + $title = mb_convert_encoding($title, _CHARSET, "UTF-8"); + $body = mb_convert_encoding($body, _CHARSET, "UTF-8"); + $more = mb_convert_encoding($more, _CHARSET, "UTF-8"); + } + // 4. add to blog $itemid = $blog->additem($catid, $title, $body, $more, $blogid, $mem->getID(), $timestamp, $closed, $draft); @@ -158,6 +165,12 @@ function _edititem($itemid, $username, $password, $catid, $title, $body, $more, if (!$mem->canAlterItem($itemid)) return _error(7,"Not allowed to alter item"); + if (strtolower(_CHARSET) != 'utf-8') { + $title = mb_convert_encoding($title, _CHARSET, _CHARSET.",UTF-8"); + $body = mb_convert_encoding($body, _CHARSET, _CHARSET.",UTF-8"); + $more = mb_convert_encoding($more, _CHARSET, _CHARSET.",UTF-8"); + } + // 3. update item ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, 0);