[EMAIL PROTECTED] wrote:
[snip]

> The switch statement in method "protected void chardata(String
> text)throws XmlRpcException, IOException" (line 310) in class
> org.apache.xmlrpc.XmlWriter does not allow character codes outside
> the 0x20 - 0xFF range prohibiting any serious use of the library
> other than for demonstrations.
>
> I've fixed that by allowing all valid XML characters, but I would
> prefer you to provide a perhaps more conservative-safe solution plus
> integrate it in a next version of the library.


Unitl very recently it was believed that the XML-RPC specification required
that strings contain only USASCII characters. The Apache implementation is
more liberal than this and allows all ISO 8859/1 characters which are also
vaild XML characters (i.e. only \r, \n and \t of the control characters are
allowed). It also sets the encoding attribute of the document to be 8859-1.

If you have modified the code to allow Unicode characters with values > 255
to be written you must ensure that these are written as numeric character
references (e.g. Ş).

The "bug" you report is expected behaviour of the system as it stands and is
not a bug.

In the light of the recent "clarification" of the spec I think it may well
be appropriate to modify the behaviour of the software. There seem to me to
be two options:

1/ Keep the 8859-1 encoding and emit numeric character references for
characters > 255
2/ Remove the 8859-1 encoding attribute and emit UTF-8 (or, as a user
option, UTF-16).

Complient XML parsers will handle either of the above.

John Wilson
The Wilson Partnership
http://www.wilson.co.uk

Reply via email to