3112Re: [soaplite] Useful module to use with SOAP::Lite
- Nov 5, 2003Hi Duncan,
> > Using SOAP::Lite intensively (thanks Paul!), I had to deal with twoIf you concatenate a utf8 flagged string with a non utf8 flagged string,
> > minor issues:
> > - soap calls return utf8 strings, even if the content doesn't have any
> > utf8 encoded characters. This is a "feature" of the XML parser. This
> > be annoying when you put this utf8 data in an HTML template and
> > an iso=* encoding in the HTML header. The result will be a utf8 page
> > rendered as a iso-* content, which is messy. Most XML related module
> > produce the same "effect".
> Not sure that I understand the problem that you are describing. A utf8
> string that has no multi-byte sequences is identical to an ASCII string
> as it is limited to 7 bits and should then be compatible with ISO-8859
the result will be a utf8 flagged string. The problems happens when you
display an html page and you specify a charset iso-xxxx because you
expect your content to be iso-xxx. If you mix strings from SOAP::Lite
(flagged utf8 - even if it doesn't contain any utf8 characters) and some
other content (non utf8), the result is a utf8 content.
The browser will receive a utf8 encoded html page with a html header
telling him that is is actually iso-xxxx encoded. The result is bad.
> > - When you send data structures containing blessed referencesI should update the doc then.
> > the encoded XML is different than if the data was not blessed. This
> > have some undesirable side effects with non perl SOAP implementations.
> > So, here is a new module Data::Structure::Util:
> > It enables, amongst other things, to encode/decode any string to/from
> > utf8 within a data structure. It also enables to remove the blessing
> > any reference within the structure.
> Looking at the POD for the module it is not clear what the utf8_on() and
> off() routines do. Do they simply set or clear the utf8 flag attached to
> each scalar? Or do they do more than that?
They do more than that, they actually call the perl API to encode/decode (if possible) the string.
The flag will be set/unset as the result of the transformation.
- << Previous post in topic Next post in topic >>