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

RE: [soaplite] wrong encoding (perhabs caused by utf8?)

Expand Messages
  • Tim Jenness
    ... The & replacement should happen first, otherwise the & in < will become &lt;. -- Tim Jenness JAC software http://www.jach.hawaii.edu/~timj
    Message 1 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.