[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[JDEV] Further encoding thoughts



One more thought...

What if we did something along these lines for encoding...

<login>
	<encoding type="ISO-8859-1">
	<user><![CDATA[...]]></user>
	<encoding type="UTF8">
	<pass>APASSWORD</pass>
</login>

So, everytime a <encoding> tag is encountered, all CDATA segments following
will be properly escaped and setup to contain data in the specified encoding,
until another encoding tag is encountered. When the server or client recvs this
packet and begins walking the DOM, it can be setup to appropriately handle
different encodings -- if it supports them. Otherwise, it can make a
"best-guess" about the data, without bothering to check for encoding "hints" and
try and read it without decoding?!

The only downside to such an approach would be the fact that it requires the
packet to be reassembled in the order it was created (although any decent DOM
should do this, right?). 

D.