From: Martin K. <mar...@fe...> - 2008-02-06 08:47:40
|
Hi there, there's a bug report open on CPAN RT (http://rt.cpan.org//Ticket/Display.html?id=32952) about the (wrong) handling of unicode strings in SOAP::Lite. The current SOAP::Lite serializes utf8-strings as base64binary with autotyping enabled. On deserialization, the utf8 flag is not restored (which is correct, as base64binary data is a sequence of octets). Thus, a utf8 string sent appears as a sequence of octet at the receiver. There are two suggested resolutions: 1. Don't serialize utf8-strings as base64binary. This only works in perls >= 5.8, as there's no way to detect utf8 strings in perls before. 2. Introduce a "utf8binary" type, which behaves as the base64binary, except that the utf8 flag is restored on deserialization. I prefer 1), as there's no "utf8binary" type in the SOAP standard, and fixing it for perls before 5.8 is pretty useless (these can't handle utf8 data anyway) SOAP 1.2 demands the use of utf-8 or utf-16 in HTTP transports, so there should be no encoding problem - and the transport layer has to re-encode the envelope if needed (like for using quoted-printable for E-Mails). The problem is, 1) may break existing SOAP::Lite clients and servers relying on the encoding of utf8 data as base64binary. What do you think? Regards, Martin |
From: Scott W. <sc...@pe...> - 2008-02-06 15:41:51
|
On Wed, Feb 06, 2008 at 08:52:39AM +0100, Martin Kutter wrote: > There are two suggested resolutions: > > 1. Don't serialize utf8-strings as base64binary. > This only works in perls >= 5.8, as there's no way to detect utf8 > strings in perls before. > > 2. Introduce a "utf8binary" type, which behaves as the base64binary, > except that the utf8 flag is restored on deserialization. > > I prefer 1), as there's no "utf8binary" type in the SOAP standard, and > fixing it for perls before 5.8 is pretty useless (these can't handle > utf8 data anyway) Perhaps it becomes a package variable that can be set, and leave it off by default so that people who upgrade won't break. Breaking things is really bad. $SOAP::Lite::NO_SERIALIZE_UT8 = 1; or something like that. Scott -- Scott Wiersdorf <sc...@pe...> |
From: Paul K. <pau...@ya...> - 2008-02-07 05:31:02
|
Martin, I also prefer option 1. As far as I understand, it would only (potentially) impact non-UTF aware clients/servers. Would it be better to add an option and keep the existing behavior by default, but allow users to turn the base64 encoding off? Paul. --- Martin Kutter <mar...@fe...> wrote: > Hi there, > > there's a bug report open on CPAN RT > (http://rt.cpan.org//Ticket/Display.html?id=32952) about the > (wrong) > handling of unicode strings in SOAP::Lite. > > The current SOAP::Lite serializes utf8-strings as base64binary with > autotyping enabled. On deserialization, the utf8 flag is not > restored > (which is correct, as base64binary data is a sequence of octets). > Thus, > a utf8 string sent appears as a sequence of octet at the receiver. > > There are two suggested resolutions: > > 1. Don't serialize utf8-strings as base64binary. > This only works in perls >= 5.8, as there's no way to detect utf8 > strings in perls before. > > 2. Introduce a "utf8binary" type, which behaves as the > base64binary, > except that the utf8 flag is restored on deserialization. > > I prefer 1), as there's no "utf8binary" type in the SOAP standard, > and > fixing it for perls before 5.8 is pretty useless (these can't > handle > utf8 data anyway) > > SOAP 1.2 demands the use of utf-8 or utf-16 in HTTP transports, so > there > should be no encoding problem - and the transport layer has to > re-encode > the envelope if needed (like for using quoted-printable for > E-Mails). > > The problem is, 1) may break existing SOAP::Lite clients and > servers > relying on the encoding of utf8 data as base64binary. > > What do you think? > > Regards, > > Martin > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Soaplite-devel mailing list > Soa...@li... > https://lists.sourceforge.net/lists/listinfo/soaplite-devel > ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |