Loading ...
Sorry, an error occurred while loading the content.

5620UTF-8 literals in PERL 5.6

Expand Messages
  • steve_slotnick
    Sep 25, 2006
    • 0 Attachment
      Hi,

      I recently encountered a problem using SOAP::Lite in PERL 5.6 and I'm
      having trouble understanding exactly what caused this issue. We're
      using version 0.50 of SOAP::Lite (yes, old!).

      I'm running a web service that returns Japanese characters. Normally
      when I read the characters into PERL from a database or file
      everything works fine. I then add the value to the SOAP response as
      follows:

      my $temp = SOAP::Data->name('MyString')
      ->type("string")
      ->value($str);

      However, recently I made a modification where the string I am
      inserting does not come from a database, but the characters are in the
      code as literals:
      my $literals = "\x{767a}\x{9001}";

      I am then inserting into the response the same way as before.
      However, the actual response from the service comes out garbled. The
      value assigned by literals shows up as expected, but all other values
      pulled from other sources is unreadable. If I do a pack("C*",
      unpack("U*", $literals)), then everything else is readable but (of
      course), the literal string is garbled.

      I have this working properly in a PERL 5.8 environment with a newer
      version of SOAP::Lite, but I'd like to understand what is going on
      here. Anyone have any ideas?

      Thanks!!
      --Steve