Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 75169
Status: rejected
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: MITHALDU [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.714
Fixed in: (no value)



Subject: transport of UTF-8 strings is broken
I have written a small failing test to demonstrate the issue: https://gist.github.com/1870757 Right now it seems impossible to transport UTF-8 strings with SOAP::Lite and get them back unmolested and useful, meaning users have to resort to walking the tree of their response and convert all strings encountered (and i don't even want to think about what happens to hash keys) or do some sort of monkey-patching. The serialization should be able to transport strings verbatim.
Hi, this is not a bug - it's a feature: In particular, it's SOAP::Lite's autotyping feature, which tries to type-guess the content, and, in your case, decides to Base64 encode the string containing the umlaut character. The base64 encoding is easily seen by printing out the serialized envelope - the string in question has the xsi:type="xsd:base64Binary". To make SOAP::Lite treat umlaut characters as verbatim strings, set $soap->autotype(0). The correct test is (works): my $data = "mü"; my $soap = SOAP::Serializer->new(); $soap->autotype(0); my $xml = $soap->envelope( freeform => "$data" ); my ( $cycled ) = values %{ SOAP::Deserializer->deserialize( $xml )->body }; is( length( $data ), length( $cycled ), "UTF-8 string is the same after serializing" ); Best regards, Martin