問(wèn)題描述: 欢欢 。 環(huán)境:PHP內(nèi)置XML-RPC的API,Apache的XML-RPC的JAVA API PHP下的解決方法: $output_options = array( $output_options = array("output_type" => "php"); 原文說(shuō)明如下: output_type: return data as either php native data types or xml encoded. ifphp is used, then the other values are ignored. default = xml verbosity: determine compactness of generated xml. options are no_white_space, newlines_only, and pretty. default = pretty escaping: determine how/whether to escape certain characters. 1 or more values are allowed. If multiple, they need to be specified as a sub-array. options are: cdata, non-ascii, non-print, and markup.default = non-ascii, non-print, markup version: version of xml vocabulary to use. currently, three are supported: xmlrpc, soap 1.1, and simple. The keyword auto is also recognized to mean respond in whichever version the request came in. default = auto (when applicable), xmlrpc encoding: the encoding that the data is in. Since PHP defaults to iso-8859-1 you will usually want to use that. Change it if you know what you are doing. default=iso-8859-1 經(jīng)過(guò)測(cè)試關(guān)鍵是在"escaping" => array("markup")這個(gè)值上,將第三個(gè)參數(shù)傳入如下值就可以解決問(wèn)題了: $output_options = array(
找遍了Apache提供的API好像也沒(méi)有找到類(lèi)似PHP那樣的第三個(gè)參數(shù),實(shí)在無(wú)奈發(fā)現(xiàn)他提供了一個(gè)Base64的類(lèi),我便只好將所有的中文字符在Client端用 Base64編碼,然后request到Server上,然后在Server端在用Base64解碼,哈哈~~~問(wèn)題也能解決!不過(guò)不知道還有沒(méi)別的更好的辦法了? 誰(shuí)有更好的解決方法請(qǐng)和我聯(lián)系: |
溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!