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

Re: [soaplite] mod_soap and iso-8859-1

Expand Messages
  • Brad Miele
    I discovered the same issue with mod_perl and Encode, and so I just do this to strings before i send them out: $stringtoclean =~ s/([^ x00- x7F])/ &# .
    Message 1 of 5 , Aug 2, 2005
    • 0 Attachment
      I discovered the same issue with mod_perl and Encode, and so I just do this to strings before i send them out:

      $stringtoclean =~ s/([^\x00-\x7F])/'&#' . ord($1) . ';'/gse;

      I am sure that this is a bad idea for some reason or other, but it has ensured that everything is UTF8 friendly for both mod_perl and cgi.

      On 7/29/05, cedric.boufflers <cedric.boufflers@... > wrote:
      Hello Andrew,

      On my PERL WebService (Perl 5.8) I do something similar to the following
      code before to return strings:

      use Encode;

      my $value = encode("UTF-8", $latin1string);
      return SOAP::Data->type( 'string' )->name( 'result' => $value );

      Thus I attempt to encode everything UTF-8 because SOAP::Lite is UTF-8
      native as well as PERL. Although this method seems to work well with
      cgi-bin but not quite well with mod_perl, but I think it is more related
      to our server and mod_perl configuration so it might work well in both
      case for you.

      If this doesn't work, you might also want to look at the documentation
      for this module :
      Encode::Encoder
      Encode::Guess

      They might help you :-)

      If you find other interesting things on how to deal with encoding and
      SOAP, then I'd be glad if you could share it with me as well, because I
      still have some issues with encoding :-(

      Best Regards,
      Cédric


      Andrew Hicox a écrit :

      >Hello everyone:
      >
      >I've got a service running on a mod_soap (Apache::SOAP) service, that
      >takes some user input and puts it in a database. When users would
      >enter international characters, the method would bomb with errors of
      >this type:
      >
      >"not well-formed (invalid token) at line ..."
      >
      >I fixed this in the client by specifying iso-8859-1 encoding on the
      >soap object before sending the call to the method on the server.
      >Everything seems okay with that.
      >
      >I also have a separate method on the same soap server which reutrns
      >text out of the database. When a user selects a record containing
      >international characters, the method again dies with the invalid token
      >error.
      >
      >I presume I need to find a way to iso-8859-1 encode the response from
      >the server. I cannot seem to find any documentation on how to do this,
      >apart from this very old messaage:
      >
      >http://groups.yahoo.com/group/soaplite/message/779
      >
      >I cannot make the method described in that message work, because I
      >cannot find a way to make apache recognize the '/perl_soap' location.
      >
      >$Location{...} does not seem to actually DO anything.
      >
      >there has to be a better way than this, I would think.
      >
      >what am I doing wrong?
      >
      >-Andrew
      >
      >
      >
      >
      >
      >Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >

      >


      --
      ---------------------------------------------------------------------
      BOUFFLERS Cédric : cedric.boufflers@...
      ---------------------------------------------------------------------
      NordNet - 111 Rue de Croix - 59510 Hem - France
      tél : +33 3 20 66 55 55 - fax : +33 3 20 66 55 59
      ---------------------------------------------------------------------
      http://www.securitoo.com/
      http://www.nordnet.fr/
      http://www.lerelaisinternet.com/
      ---------------------------------------------------------------------



      YAHOO! GROUPS LINKS






      --
      Brad Miele                                                                                                                        
      Technology Director                                                                                                                
      IPNStock                                                                                                                          
      (866) 476-7862 x902                                                                                                                
      bmiele@...
    Your message has been successfully submitted and would be delivered to recipients shortly.