【发布时间】:2013-08-03 13:30:14
【问题描述】:
我正在使用带有最新 XmlRpcPlugin 的 trac 1.0.1。像这样使用 python 添加票证时,非 ASCII 字符(在此示例中为 ä)会正确插入:
import xmlrpclib
server = xmlrpclib.ServerProxy('https://user:pwd@localhost/trac/login/xmlrpc')
server.ticket.create("Täst", "Täst")
现在我想像这样使用phpxmlrpc 添加一张票:
$client = new xmlrpc_client("https://localhost/trac/xmlrpc");
$client->setCredentials("usr", "pwd", CURLAUTH_BASIC);
$xmlrpc_msg = new xmlrpcmsg('ticket.create', array(new xmlrpcval("Täst"), new xmlrpcval("Täst"));
$xmlrpc_resp = $client->send($xmlrpc_msg);
我现在收到此错误:not well-formed (invalid token): line 6, column 57 并且未插入票证。
将$client->request_charset_encoding 设置为UTF-8 或ISO-8859-1 时,两次都插入票证,但所有非ASCII 字符格式错误。
我怎样才能让它工作?
【问题讨论】: