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

way to pass strings with accents ?

Expand Messages
  • OVH - Sylvain Trias
    Hi, I m having little problems with functions having to return data containing strings with (french) accents (éè...). What should I use to get it passed
    Message 1 of 4 , Jun 9, 2004
    • 0 Attachment
      Hi,

      I'm having little problems with functions having to return data
      containing strings with (french) accents (éè...).

      What should I use to get it passed properly to the client ?




      I'm trying to send :

      $VAR1 = {
      'value' => {
      'country' => 'FR',
      'nom' => 'Trias',
      'organisation' => '13 Tupides',
      'nic' => 'ts319-ovh',
      'prenom' => 'Bébért',
      ....
      },
      'status' => 100
      };


      (then I return the this hash embeded in another one, everything is ok)

      But the key prenom -> 'Bébért' is passed to the client as 'Quli6XJ0'
    • Andrew Curry
      i would guess that its because the defult encoding for xml/soap it utf-8 in your call you can specify the encoding type you require i.e. my $result =
      Message 2 of 4 , Jun 9, 2004
      • 0 Attachment
        i would guess that its because the defult encoding for xml/soap it utf-8
        in your call you can specify the encoding type you require i.e.

        my $result = SOAP::Lite
        -> proxy (...)
        -> uri (...)
        # specify encoding, because default is utf-8
        -> encoding('iso-8859-1')
        -> hello($string)
        -> result;

        -----Original Message-----
        From: OVH - Sylvain Trias [mailto:bozo@...]
        Sent: 09 June 2004 11:32
        To: soaplite@yahoogroups.com
        Subject: [soaplite] way to pass strings with accents ?


        Hi,

        I'm having little problems with functions having to return data
        containing strings with (french) accents (éè...).

        What should I use to get it passed properly to the client ?




        I'm trying to send :

        $VAR1 = {
        'value' => {
        'country' => 'FR',
        'nom' => 'Trias',
        'organisation' => '13 Tupides',
        'nic' => 'ts319-ovh',
        'prenom' => 'Bébért',
        ....
        },
        'status' => 100
        };


        (then I return the this hash embeded in another one, everything is ok)

        But the key prenom -> 'Bébért' is passed to the client as 'Quli6XJ0'





        Yahoo! Groups Links
      • eric-amick@comcast.net
        ... I believe SOAP::Lite uses Base64 encoding by default for string data that is not ASCII. Try using SOAP::Data- type() to explicitly specify the type, such
        Message 3 of 4 , Jun 9, 2004
        • 0 Attachment
          > I'm having little problems with functions having to return data
          > containing strings with (french) accents (��...).
          >
          > What should I use to get it passed properly to the client ?
          >
          >
          >
          >
          > I'm trying to send :
          >
          > $VAR1 = {
          > 'value' => {
          > 'country' => 'FR',
          > 'nom' => 'Trias',
          > 'organisation' => '13 Tupides',
          > 'nic' => 'ts319-ovh',
          > 'prenom' => 'B�b�rt',
          > ....
          > },
          > 'status' => 100
          > };
          >
          >
          > (then I return the this hash embeded in another one, everything is ok)
          >
          > But the key prenom -> 'B�b�rt' is passed to the client as 'Quli6XJ0'

          I believe SOAP::Lite uses Base64 encoding by default for string data that is not ASCII. Try using SOAP::Data->type() to explicitly specify the type, such as:

          $myhash{prenom} = SOAP::Data->type(string => $prenomvalue);

          --
          Eric Amick
          Columbia, MD
        • Paul Kulchenko
          In addition to Andrew s and Eric s responses you may also want to check this page that talks about internationalization: http://conf.soaplite.com/p2p/35.html
          Message 4 of 4 , Jun 9, 2004
          • 0 Attachment
            In addition to Andrew's and Eric's responses you may also want to
            check this page that talks about internationalization:

            http://conf.soaplite.com/p2p/35.html

            Paul.

            --- OVH - Sylvain Trias <bozo@...> wrote:
            > Hi,
            >
            > I'm having little problems with functions having to return data
            > containing strings with (french) accents (��...).
            >
            > What should I use to get it passed properly to the client ?
            >
            >
            >
            >
            > I'm trying to send :
            >
            > $VAR1 = {
            > 'value' => {
            > 'country' => 'FR',
            > 'nom' => 'Trias',
            > 'organisation' => '13 Tupides',
            > 'nic' => 'ts319-ovh',
            > 'prenom' => 'B�b�rt',
            > ....
            > },
            > 'status' => 100
            > };
            >
            >
            > (then I return the this hash embeded in another one, everything is
            > ok)
            >
            > But the key prenom -> 'B�b�rt' is passed to the client as
            > 'Quli6XJ0'
            >
            >
            >
            > ------------------------ Yahoo! Groups Sponsor
            > --------------------~-->
            > Yahoo! Domains - Claim yours for only $14.70
            > http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/W6uqlB/TM
            >
            --------------------------------------------------------------------~->
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.