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

wrong encoding (perhabs caused by utf8?)

Expand Messages
  • Marten Lehmann
    Hello, I m using SOAP::Lite 0.55 on client and server side. Server is using en_US.iso885915, client is using en_US.UTF-8. The content from the server n
    Message 1 of 7 , Jul 20, 2004
    • 0 Attachment
      Hello,

      I'm using SOAP::Lite 0.55 on client and server side. Server is using
      en_US.iso885915, client is using en_US.UTF-8. The content from the server

      <br>\n

      (\n = feal newline, not \\n)

      ends at client side with:

      <br>

      That's not what I want. I don't know how to check if the server has a
      problem on encoding or the client on decoding. How can I fix it?

      Regards
      Marten
    • Marten Lehmann
      Hello, I did some experiments, but I couldn t solve the problem. I installed the latest SOAP-Lite (0.60a) on client and server, but I still get e.g. &euro;
      Message 2 of 7 , Jul 20, 2004
      • 0 Attachment
        Hello,

        I did some experiments, but I couldn't solve the problem. I installed
        the latest SOAP-Lite (0.60a) on client and server, but I still get e.g.

        &euro;

        instead of €

        How can I check if the problem is on client or server side and locate it?

        Regards
        Marten
      • Duncan Cameron
        ... If your server returns the string € , SOAP::Lite should escape the & when creating the message and un-escape at the client. Can you provide samples
        Message 3 of 7 , Jul 20, 2004
        • 0 Attachment
          At 2004-07-20, 16:22:06 Marten Lehmann <lehmann@...> wrote:

          >Hello,
          >
          >I did some experiments, but I couldn't solve the problem. I installed
          >the latest SOAP-Lite (0.60a) on client and server, but I still get e.g.
          >
          >&euro;
          >
          >instead of €
          >
          >How can I check if the problem is on client or server side and locate
          >it?
          >
          If your server returns the string '€', SOAP::Lite should escape
          the & when creating the message and un-escape at the client. Can you
          provide samples of your client and server code?

          Regards
          Duncan
        • Marten Lehmann
          Hello, I finally figured out the problem: It was due to the missing perl module XML::Parser. It would be nice, if SOAP::Lite could yell a warning if it doesn t
          Message 4 of 7 , Jul 20, 2004
          • 0 Attachment
            Hello,

            I finally figured out the problem: It was due to the missing perl module
            XML::Parser. It would be nice, if SOAP::Lite could yell a warning if it
            doesn't find the required modules to do his job!

            Regards
            Marten
          • Maurice McCabe
            The XML standard requires that certain characters contained within the XML document content be escaped. Otherwise it is not a legal XML document. I use the
            Message 5 of 7 , Jul 20, 2004
            • 0 Attachment
              Message
              The XML standard requires that certain characters contained within the XML document content be escaped. Otherwise it is not a legal XML document. I use the following subroutine to do the substitution. It only contains the values I needed to escape. There may be other values not included in my list.
               
              sub escape {
                  # must escape certain characters or the XML document is invalid
                  my ($str) = @_;
                  $str =~ s/</&lt;/g;
                  $str =~ s/>/&gt;/g;
                  $str =~ s/&/&amp;/g;
                  $str =~ s/"/&quote;/g;
                  $str =~ s/'/&apos;/g;
               
                  # strip out invalid characters (according to Mircosoft)
                  #$str =~ s/[:\-\n\r()]//g;

                  return $str;
              }
               
              Regards,
               
              Maurice
              -----Original Message-----  
              From: Duncan Cameron [mailto:duncan_cameron2002@...]
              Sent: Tuesday, July 20, 2004 8:33 AM
              To: Marten Lehmann; soaplite@yahoogroups.com
              Subject: Re: [soaplite] wrong encoding (perhabs caused by utf8?)

              At 2004-07-20, 16:22:06 Marten Lehmann <lehmann@...> wrote:

              >Hello,
              >
              >I did some experiments, but I couldn't solve the problem. I installed
              >the latest SOAP-Lite (0.60a) on client and server, but I still get e.g.
              >
              >&amp;euro;
              >
              >instead of &euro;
              >
              >How can I check if the problem is on client or server side and locate
              >it?
              >
              If your server returns the string '&euro;', SOAP::Lite should escape
              the & when creating the message and un-escape at the client. Can you
              provide samples of your client and server code?

              Regards
              Duncan



            • Maurice McCabe
              Use it to remove offending characters from data values before inserting into XML doc. Something like this: SOAP::Data- name( Product_Name =
              Message 6 of 7 , Jul 20, 2004
              • 0 Attachment
                Message
                Use it to remove offending characters from data values before inserting into XML doc. Something like this:
                 
                SOAP::Data->name("Product_Name" => escape($Product_Name))
                -----Original Message-----
                From: Maurice McCabe [mailto:mmccabe@...]
                Sent: Tuesday, July 20, 2004 3:44 PM
                To: soaplite@yahoogroups.com
                Subject: RE: [soaplite] wrong encoding (perhabs caused by utf8?)

                The XML standard requires that certain characters contained within the XML document content be escaped. Otherwise it is not a legal XML document. I use the following subroutine to do the substitution. It only contains the values I needed to escape. There may be other values not included in my list.
                 
                sub escape {
                    # must escape certain characters or the XML document is invalid
                    my ($str) = @_;
                    $str =~ s/</&lt;/g;
                    $str =~ s/>/&gt;/g;
                    $str =~ s/&/&amp;/g;
                    $str =~ s/"/&quote;/g;
                    $str =~ s/'/&apos;/g;
                 
                    # strip out invalid characters (according to Mircosoft)
                    #$str =~ s/[:\-\n\r()]//g;

                    return $str;
                }
                 
                Regards,
                 
                Maurice
                -----Original Message-----  
                From: Duncan Cameron [mailto:duncan_cameron2002@...]
                Sent: Tuesday, July 20, 2004 8:33 AM
                To: Marten Lehmann; soaplite@yahoogroups.com
                Subject: Re: [soaplite] wrong encoding (perhabs caused by utf8?)

                At 2004-07-20, 16:22:06 Marten Lehmann <lehmann@...> wrote:

                >Hello,
                >
                >I did some experiments, but I couldn't solve the problem. I installed
                >the latest SOAP-Lite (0.60a) on client and server, but I still get e.g.
                >
                >&amp;euro;
                >
                >instead of &euro;
                >
                >How can I check if the problem is on client or server side and locate
                >it?
                >
                If your server returns the string '&euro;', SOAP::Lite should escape
                the & when creating the message and un-escape at the client. Can you
                provide samples of your client and server code?

                Regards
                Duncan




              • Tim Jenness
                ... The & replacement should happen first, otherwise the & in < will become &lt;. -- Tim Jenness JAC software http://www.jach.hawaii.edu/~timj
                Message 7 of 7 , Jul 20, 2004
                • 0 Attachment
                  On Tue, 20 Jul 2004, Maurice McCabe wrote:

                  > The XML standard requires that certain characters contained within the
                  > XML document content be escaped. Otherwise it is not a legal XML
                  > document. I use the following subroutine to do the substitution. It only
                  > contains the values I needed to escape. There may be other values not
                  > included in my list.
                  >
                  > sub escape {
                  > # must escape certain characters or the XML document is invalid
                  > my ($str) = @_;
                  > $str =~ s/</</g;
                  > $str =~ s/>/>/g;
                  > $str =~ s/&/&/g;
                  > $str =~ s/"/"e;/g;
                  > $str =~ s/'/'/g;

                  The & replacement should happen first, otherwise the '&' in < will
                  become &lt;.

                  --
                  Tim Jenness
                  JAC software
                  http://www.jach.hawaii.edu/~timj
                Your message has been successfully submitted and would be delivered to recipients shortly.