[xdebug-general] Understanding the feature "encoding"

From: Dave Kelsey <d_kelsey[@]uk.ibm.com>
Date: Tue, 1 May 2007 11:27:50 +0100

Derick, I wonder if you clarify something for me

The DBGp protocol document states that commands are in ASCII format.
However information passed as parameters into these commands may not be
encodable to ascii bytes. These are things such as filename, variable
name, function/method/class name.

Filename is handled by encoding it to a URI, but in theory a PHP script
can define variables, functions etc using non-ascii characters, which
means that just encoding a command to ASCII bytes may not work as
expected.

The encoding feature property can define the encoding for the XML document
response, but can it also describe the encoding for commands (so long as
the encoding used is a superset of ascii) ? The documentation is not clear
on this point.

There are 2 reasons for this
1. Variables received by the debug client from XML in Java are converted
to strings based on the XML encoding, so in order to send them back in a
byte format that the php engine can understand means I should send them
back decoded back to that encoding (I could use the value in the XML
document to determine that)
2. Any information initiated by the debug client rather than received from
the php engine such as methods/functions/class names, or variable names
not determined from (1) need to be in a byte form that the script engine
can utilise. In a java based debug client these could be java.lang.String
and to convert to bytes I need to specify the encoding to use.

If encoding represents both the command encoding and the xml document
encoding, then this allows me to address both issues 1 and 2 in hopefully
a satisfactory manner.

Your thoughts and help on this would be greatly appreciated.

Dave Kelsey

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Received on Tue May 01 2007 - 12:27:59 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST