Skip to Content
avatar image
Former Member

Changing the xml encoding from UTF-8 to ISO-8859-1

Hi,

I have created an xml file in xMII transaction that I feed into a webservice as input. As of now, the data in the xml file is entirely english text (it would be changing to have European text soon). I gave the encoding as UTF-8.

I get an error on the webservice side(not xMII code) that the its not able to parse. The error is 'SaxParseException: Invalid 1 of 1-byte UTF-8 sequence). I know that an easy fix is if tI change the encoding to iso-8859-1.

But the reference document doesnot let me put anythign other than UTF-8. Even if I put <?xml version="1.0" encoding="iso-8859-1"?> as the first line, when I save it and open it back, i see <?xml version="1.0" encoding="UTF-8"?>

Is there any way to change the encoding? Or better still, anyway idea why this invalid sequence is coming from?

Thanks,

Ravi.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 07, 2008 at 04:36 AM

    Hi Ravi,

    We have encountered scenarios where we needed to take the <?xml version="1.0" encoding="UTF-8"?> out completely. As xMII was providing the Web Service, it needed a workaround.

    In your case, it seems that you wish to pass it from xMII to an external Web Service provider. One option might be to pass the XML document as string.

    Once you convert it to a string, it may escape all XMl characters (i.e. '<' into '&lt;'). You could perform a string manipulation and remove the <?xml version="1.0" encoding="UTF-8"?> from the string. You may also need to play around with xmlDecode( string ) function in the Link Editor.

    I would suggest that before you try this option, create a string variable will the contents, but without the <?xml version="1.0" encoding="UTF-8"?> and try assigning it to the input.

    You may also wish to try a string variable that has <?xml version="1.0" encoding="iso-8859-1"?> as the first line. If this works, you should be able to perform string manipulations to convert your XML document into this modified string.

    Cheers,

    Jai.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 07, 2008 at 08:06 PM

    This most probably is an indication that your XML contains an invalid character.

    Post the XML for the forum.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks Rick. I think using the post should solve the problem with the encoding. Will try it tomorrow.

      But one problem is that I am not able to save the xml templates with any encoding other than utf-8. Then again, I can use the post xml as a text message. Hope this solves the problem but is there any way to save the xml templates in any other format in 11.5 SR3?

      Ravi.