This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Incam_SGD/thirdparty/xmlrpc-2.2/doc/ch08s02.html

10 lines
5.9 KiB
HTML

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>2.&nbsp;Variables whose value can be modified</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="XML-RPC for PHP"><link rel="up" href="ch08.html" title="Chapter&nbsp;8.&nbsp;Global variables"><link rel="prev" href="ch08s01.html" title="1.&nbsp;&#34;Constant&#34; variables"><link rel="next" href="ch09.html" title="Chapter&nbsp;9.&nbsp;Helper functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.&nbsp;Variables whose value can be modified</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch08s01.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;8.&nbsp;Global variables</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch09.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2751"></a>2.&nbsp;Variables whose value can be modified</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xmlrpc-defencoding"></a>2.1.&nbsp;xmlrpc_defencoding</h3></div></div></div><code class="fieldsynopsis"><span class="varname">$xmlrpc_defencoding&nbsp;</span><span class="initializer">=&nbsp;"UTF8"</span>;</code><p>This variable defines the character set encoding that will be used by the xml-rpc client and server to decode the received messages, when a specific charset declaration is not found (in the messages sent non-ascii chars are always encoded using character references, so that the produced xml is valid regardless of the charset encoding assumed).</p><p>Allowed values: <code class="literal">"UTF8"</code>, <code class="literal">"ISO-8859-1"</code>, <code class="literal">"ASCII".</code></p><p>Note that the appropriate RFC actually mandates that XML received over HTTP without indication of charset encoding be treated as US-ASCII, but many servers and clients 'in the wild' violate the standard, and assume the default encoding is UTF-8.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2776"></a>2.2.&nbsp;xmlrpc_internalencoding</h3></div></div></div><p><code class="fieldsynopsis"><span class="varname">$xmlrpc_internalencoding&nbsp;</span><span class="initializer">=&nbsp;"ISO-8859-1"</span>;</code>This variable defines the character set encoding that the library uses to transparently encode into valid XML the xml-rpc values created by the user and to re-encode the received xml-rpc values when it passes them to the PHP application. It only affects xml-rpc values of string type. It is a separate value from xmlrpc_defencoding, allowing e.g. to send/receive xml messages encoded on-the-wire in US-ASCII and process them as UTF-8. It defaults to the character set used internally by PHP (unless you are running an MBString-enabled installation), so you should change it only in special situations, if e.g. the string values exchanged in the xml-rpc messages are directly inserted into / fetched from a database configured to return UTF8 encoded strings to PHP. Example usage:</p><pre class="programlisting">
&lt;?php
include('xmlrpc.inc');
$xmlrpc_internalencoding = 'UTF-8'; // this has to be set after the inclusion above
$v = new xmlrpcval('&Icirc;&ordm;&aacute;&frac12;&sup1;&Iuml;&#131;&Icirc;&frac14;&Icirc;&micro;'); // This xmlrpc value will be correctly serialized as the greek word 'kosme'
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2789"></a>2.3.&nbsp;xmlrpcName</h3></div></div></div><p><code class="fieldsynopsis"><span class="varname">$xmlrpcName&nbsp;</span><span class="initializer">=&nbsp;"XML-RPC for PHP"</span>;</code>The string representation of the name of the XML-RPC for PHP library. It is used by the client for building the User-Agent HTTP header that is sent with every request to the server. You can change its value if you need to customize the User-Agent string.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2799"></a>2.4.&nbsp;xmlrpcVersion</h3></div></div></div><p><code class="fieldsynopsis"><span class="varname">$xmlrpcVersion&nbsp;</span><span class="initializer">=&nbsp;"2.2"</span>;</code>The string representation of the version number of the XML-RPC for PHP library in use. It is used by the client for building the User-Agent HTTP header that is sent with every request to the server. You can change its value if you need to customize the User-Agent string.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2809"></a>2.5.&nbsp;xmlrpc_null_extension</h3></div></div></div><p>When set to <code class="constant">TRUE</code>, the lib will enable support for the &lt;NIL/&gt; xmlrpc value, as per the extension to the standard proposed here. This means that &lt;NIL/&gt; tags will be parsed as valid xmlrpc, and the corresponding xmlrpcvals will return "null" for <code class="methodname">scalarTyp()</code>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch08s01.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ch08.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch09.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">1.&nbsp;"Constant" variables&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;9.&nbsp;Helper functions</td></tr></table></div></body></html>