[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: XML not well formed for foreign characters



   The web service is supposed to be sending it encoded as UTF-8, I
   suspect the problem is on their end.
   I suspect they're putting "UTF-8" in their XML header and accepting
   whatever is entered (or copy/pasted) onto the screen, whatever the
   format, and building their XML directly from that.
   Thanks as always for your help,
   Charlie
   -----Original Message-----
   From: [1]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott
   Klement
   Sent: Tuesday, August 19, 2014 11:25 AM
   To: HTTPAPI and FTPAPI Projects
   Subject: Re: XML not well formed for foreign characters
   Charlie,
   Because you are using HTTP_XML_CALC and specifying <?xml
   encoding="utf-8"?> in the document itself, the XML parser will assume
   that you are actually using UTF-8 encoding.
   You need to make sure that any/all data you write is actually in UTF-8
   encoding. If it is in a different encoding, then you will have the sort
   of error that you're receiving.
   It's hard to tell if you are/aren't having this problem since you
   haven't told us much about how the text is encoded. Do you have any
   details of how your web service encodes the text?
   -SK
   On 8/19/2014 8:51 AM, Versfelt, Charles wrote:
   > Hi Scott,
   > We're working with an outside group, Valtech, who is creating our new
   > website. They generate the XML using information keyed into the
   website
   > (or potentially copy/pasted in) by the customer. They then send the
   XML
   > to our web service via HTTP protocol (Post Method). Our web services
   > writes the posted XML data to a file on our IFS and executes the
   stored
   > procedure on the iSeries, which parses the XML using
   > http_parse_xml_stmf.
   > Our current parameters are as follows:
   > if (http_parse_xml_stmf( filename
   > : HTTP_XML_CALC
   > : *null
   > : %paddr(Incoming)
   > : *null ) < 0 );
   > I've also learned that, if they key the information into their site
   via
   > the keyboard, the XML works. The problem only happens when they
   > copy/paste the information into their site. The potential that
   > copy/pasting data onto the site means we don't necessarily know what
   > we're getting. Naturally, while we're in testing, we could tell
   Valtech
   > not to copy/paste the data, but potentially the customers might
   > copy/paste their own information when we go live.
   > I found and read some old messages to you from others who had similar
   > problems. One person used 1252 as the second parameter. The XML DOES
   > have the tag: <?xml version="1.0" encoding="UTF-8" ?>
   > I would expect that Valtech would be sending the data properly
   > formatted, but apparently they're taking whatever is fed into their
   > site and loading it into their XML. Is this something they need to
   fix
   > on their end or that I need to handle on my end?
   > Thanks for your help,
   > Charlie
   >
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list. To unsubscribe, please go to:
   [2]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------

   This email has been scanned for viruses by Mimecast.

References

   1. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   2. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------