[phpxmlrpc-devel] Problems with ISO8859-1 encoding
Brought to you by:
ggiunta
From: Gaetano G. <giu...@se...> - 2002-09-25 07:59:26
|
I broke xmlrpc response parsing when enabling debug mode on the server = and sending a comment including chars =A9 and =AE (hope they show off ok = in the mail: ALT+0169 and ALT+0174). My best guess is I have to specify the encoding of the xml msg as = ISO-8859-1, either 1) in the <?xml?> tag within the answer msg, or 2) = with an http 'charset' header. I tried method 1 (patching the server code), and it did not work. Then, peering at the client code I found out that global variable = $xmlrpc_defencoding is used to create the XML parser. I did not try yet = overriding it, but I guess it would do. Now, my questions are: - looking at HTTP1.1 spec (RFC2616) I understood that HTTP requests of = type TEXT/XXX SHOULD(?) be treated as ISO-8859-1 encoded when an = encoding charset is omitted. So, unless the XML (or XML-RPC) spec = dictates otherwise, the default $xmlrpc_defencoding should be changed = ??? (I know xml states that only UTF-8 and UTF-16 encoding MUST be = supported...) - why not make this global variable a property of the xmlrpcmsg class? = It looks more reasonable to me: both the server and client should be = able to support seamlessly messages using different encodings. The client should then try to get the encoding used in the message, = before instantiating the xmlparser object, from: a) the HTTP HEADER, b) = the <?XML?> tag, or some combination thereof strategy (I'm not too sure = of my understanding of protcol specs...) - the encoding type could be added to the response string of the = xmlrpcserver class, also using an xmlrpc_encoding property Thanks, Gaetano |