[phc-general] String conversion

Edsko de Vries edsko at phpcompiler.org
Thu Dec 28 10:58:41 CET 2006


On Thu, Dec 28, 2006 at 10:52:20AM +0100, anorganic anorganic wrote:
> Hello,
> 
> when i use php -> xml, sometimes there is any conversion of value of string,
> example:
> 
> "file.php?send=1&get="  convert to   "ZmlsZS5waHA/c2VuZD0xJmdldD0="
> 
> can you please tell me what format is it, and how can i convert back in java
> (, c++) ?

Hi Jakub,

You should find that the XML structure is actually

<Token_string>
  ...
  <value encoding="base64">ZmlsZS5waHA/c2VuZD0xJmdldD0=</value>
</Token_string>

The attribute says it all: the encoding is Base 64, a commonly used
encoding to avoid XML malformed errors. To decode, you need a base 64
decoder. There are plenty around for Java; Google around and you should
find one very quickly.

Edsko



More information about the phc-general mailing list