XML data encoding iso-8859-1 . Currently utf-16 is default encoding

Hello ABAP Gurus ,
Need a help from you .
Scenario : We have SAP4.7 enterprise version which we have now converted to Unicode system . There is a BSP application which talks to an external web application (Non Unicode) thru HTTP protocol and sends data thru XML.
Problem : Problem is at the time when BSP application prepares the XML While preparing XML data , before converting to Unicode environment the encoding was "iso-8859-1" . But now after Unicode conversion , the encoding is "UTF-16".
The XML data looks like
<?xml version="1.0" encoding="utf-16"?><DATA><ACTION>CREATE_TICKET</ACTION><CRI
I have tried replacing "utf-16" by "iso-8859-1 " . The interface works . But at the recieving end , ie external web application , the German umlauts appear as some garbage values .
I know we need to enforce encoding . I have tried with the following code but could not suceed . The encoding appears as "utf-16".
Following is the section of code which I have written in BSP application.
  Daten in DOM-Baum wandeln
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
      EXPORTING
        name        = 'DATA'
        dataobject  = ls_cr_xml
      IMPORTING
        data_as_dom = if_dom
      CHANGING
        document    = if_document
      EXCEPTIONS
        OTHERS      = 1.
    IF sy-subrc NE 0.
      error_out text-f47 text-f48 space space.
    ENDIF.
  DOM-Baum in Character-Stream wandeln
    if_pixml = cl_ixml=>create( ).
    IF if_pixml IS INITIAL.
      error_out text-f50 text-f53 space space.
    ENDIF.
    if_pstreamfact = if_pixml->create_stream_factory( ).
    IF if_pstreamfact IS INITIAL.
      error_out text-f51 text-f53 space space.
    ENDIF.
    if_postream = if_pstreamfact->create_ostream_cstring( string = xml_doc ).
    IF if_pstreamfact IS INITIAL.
      error_out text-f52 text-f53 space space.
    ENDIF.
--Encoding--
data: gv_str type string.
data: gv_l_xml_encoding type ref to if_ixml_encoding.
data gv_l_resultb type boolean.
gv_str = 'ISO-8859-1' .
clear gv_l_xml_encoding.
      call method if_pixml->create_encoding
        EXPORTING
          byte_order    = 0
          character_set = gv_str
        RECEIVING
          rval          = gv_l_xml_encoding.
      clear gv_l_resultb.
      call method gv_l_xml_encoding->set_character_set
        EXPORTING
          charset = gv_str
        RECEIVING
          rval    = gv_l_resultb.
        call method if_document->set_encoding
        EXPORTING
          encoding = gv_l_xml_encoding.
----Append child -
CALL METHOD if_document->append_child
      EXPORTING
        new_child = if_dom
      RECEIVING
        rval      = lv_return.
    IF lv_return NE 0.
      error_out text-f47 text-f49 space space.
    ENDIF.
--Render the XML data to output stream--
    CALL METHOD if_document->render
      EXPORTING
        ostream = if_postream.
After this section of code is executed , the variable xml_doc  gets filled up with XML data .
<?xml version="1.0" encoding="utf-16"?><DATA><ACTION>CREATE_TICKET</ACTION><CRI
Can anybody help how to enforce encoding ?
Regards,
Laxman Nayak.

Hi Aslam Riaz,
Did you find any solution..?
Kindly help me on this issue.
Thanks and Regards,
Shailaja Chityala

Similar Messages

  • How to set the Xml Encoding ISO-8859-1 to Transformer or DOMSource

    I have a xml string and it already contains an xml declaration with encoding="ISO-8859-1". (In my real product, since some of the element/attribute value contains a Spanish character, I need to use this encoding instead of UTF-8.) Also, in my program, I need to add more attributes or manipulate the xml string dynamically, so I create a DOM Document object for that. And, then, I use Transformer to convert this Document to a stream.
    My problme is: Firstly, once converted through the Transformer, the xml encoding changed to default UTF-8, Secondly, I wanted to check whether the DOM Document created with the xml string maintains the Xml Encoding of ISO-8859-1 or not. So, I called Document.getXmlEncoding(), but it is throwing a runtime error - unknown method.
    Is there any way I can maintain the original Xml Encoding of ISO-8859-1 when I use either the DOMSource or Transformer? I am using JDK1.5.0-12.
    Following is my sample program you can use.
    I would appreciate any help, because so far, I cannot find any answer to this using the JDK documentation at all.
    Thanks,
    Jin Kim
    import java.io.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Attr;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Templates;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    public class XmlEncodingTest
        StringBuffer xmlStrBuf = new StringBuffer();
        TransformerFactory tFactory = null;
        Transformer transformer = null;
        Document document = null;
        public void performTest()
            xmlStrBuf.append("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n")
                     .append("<TESTXML>\n")
                     .append("<ELEM ATT1=\"Yes\" />\n")
                     .append("</TESTXML>\n");
            // the encoding is set to iso-8859-1 in the xml declaration.
            System.out.println("initial xml = \n" + xmlStrBuf.toString());
            try
                //Test1: Use the transformer to ouput the xmlStrBuf.
                // This shows the xml encoding result from the transformer which will change to UTF-8
                tFactory = TransformerFactory.newInstance();
                transformer = tFactory.newTransformer();
                StreamSource ss = new StreamSource( new StringBufferInputStream( xmlStrBuf.toString()));
                System.out.println("Test1 result = ");
                transformer.transform( ss, new StreamResult(System.out));
                //Test2: Create a DOM document object for xmlStrBuf and manipulate it by adding an attribute ATT2="No"
                DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = dfactory.newDocumentBuilder();
                document = builder.parse( new StringBufferInputStream( xmlStrBuf.toString()));
                // skip adding attribute since it does not affect the test result
                // Use a Transformer to output the DOM document. the encoding becomes UTF-8
                DOMSource source = new DOMSource(document);
                StreamResult result = new StreamResult(System.out);
                System.out.println("\n\nTest2 result = ");
                transformer.transform(source, result);
            catch (Exception e)
                System.out.println("<performTest> Exception caught. " + e.toString());
        public static void main( String arg[])
            XmlEncodingTest xmlTest = new XmlEncodingTest();
            xmlTest.performTest();
    }

    Thanks DrClap for your answer. With your information, I rewrote the sample program as in the following, and it works well now as I intended! About the UTF-8 and Spanish charaters, I think you are right. It looks like there can be many factors involved on this subject though - for example, the real character sets used to create an xml document, and the xml encoding information declared will matter. The special character I had a trouble was u00F3, and somehow, I found out that Sax Parser or even Document Builder parser does not like this character when encoding is set to "UTF-8" in the Xml document. My sample program below may not be a perfect example, but if you replaces ISO-8859-1 with UTF-8, and not setting the encoding property to the transfermer, you may notice that the special character in my example is broken in Test1 and Test2. In my sample, I decided to use ByteArrayInputStream instead of StringBufferInpuptStream because the documentation says StringBufferInputStream may have a problem with converting characters into bytes.
    Thanks again for your help!
    Jin Kim
    import java.io.*;
    import java.util.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Attr;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Templates;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    * XML encoding test for Transformer
    public class XmlEncodingTest2
        StringBuffer xmlStrBuf = new StringBuffer();
        TransformerFactory tFactory = null;
        Document document = null;
        public void performTest()
            xmlStrBuf.append("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n")
                     .append("<TESTXML>\n")
                     .append("<ELEM ATT1=\"Resoluci�n\">\n")
                     .append("Special charatered attribute test")
                     .append("\n</ELEM>")
                     .append("\n</TESTXML>\n");
            // the encoding is set to iso-8859-1 in the xml declaration.
            System.out.println("**** Initial xml = \n" + xmlStrBuf.toString());
            try
                //TransformerFactoryImpl transformerFactory = new TransformerFactoryImpl();
                //Test1: Use the transformer to ouput the xmlStrBuf.
                tFactory = TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                byte xmlbytes[] = xmlStrBuf.toString().getBytes("ISO-8859-1");
                StreamSource streamSource = new StreamSource( new ByteArrayInputStream( xmlbytes ));
                ByteArrayOutputStream xmlBaos = new ByteArrayOutputStream();
                Properties transProperties = transformer.getOutputProperties();
                transProperties.list( System.out); // prints out current transformer properties
                System.out.println("**** setting the transformer's encoding property to ISO-8859-1.");
                transformer.setOutputProperty("encoding", "ISO-8859-1");
                transformer.transform( streamSource, new StreamResult( xmlBaos));
                System.out.println("**** Test1 result = ");
                System.out.println(xmlBaos.toString("ISO-8859-1"));
                //Test2: Create a DOM document object for xmlStrBuf to add a new attribute ATT2="No"
                DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = dfactory.newDocumentBuilder();
                document = builder.parse( new ByteArrayInputStream( xmlbytes));
                // skip adding attribute since it does not affect the test result
                // Use a Transformer to output the DOM document.
                DOMSource source = new DOMSource(document);
                xmlBaos.reset();
                transformer.transform( source, new StreamResult( xmlBaos));
                System.out.println("\n\n****Test2 result = ");
                System.out.println(xmlBaos.toString("ISO-8859-1"));
                //xmlBaos.flush();
                //xmlBaos.close();
            catch (Exception e)
                System.out.println("<performTest> Exception caught. " + e.toString());
            finally
        public static void main( String arg[])
            XmlEncodingTest2 xmlTest = new XmlEncodingTest2();
            xmlTest.performTest();
    }

  • SSIS 2008 R2 : XML issue with ?xml version="1.0" encoding="iso-8859-1"?

    hi Friends,
    Please help me in below error , I am using XML data source with below encoding
    <?xml version="1.0" encoding="iso-8859-1"?>
    While generating xsd, i am getting below error. 
    '.', hexadecimal value 0x00, is an invalid character. Line 2, position 1.
    the xml is parsing correctly as i am using XML spy to check the xml.
    Any help is appritiated.
    Thanks in advance,
    Pari

    I think XMLSpy does something to swallow the null char.
    I'd inspect this file in a professional editor to determine whether (likely) a hex 0x00 is in the file.
    Arthur
    MyBlog
    Twitter

  • Iso-8859-1 to UTF-8

    JExpert,
    The encoding of my current servlet is iso-8859-1 when i execute the following method. How can I change it into UTF-8?
         public void displaySkinFile(HttpServletRequest req, HttpServletResponse resp, String skinFile) throws ServletException, IOException {
              try {
                   String fileContent = getFileContent(skinFile);
                   resp.setContentType("text/html");
    System.out.println("encoding="+resp.getCharacterEncoding());
                   PrintWriter out = resp.getWriter();
                   out.println(fileContent);
              } catch (FileNotFoundException e) {
                   logAndRedirect(req, resp, skinFile);
              } catch (IOException e) {               
                   logAndRedirect(req,resp,skinFile);
    Thanks!!

    I am having a similar problem, but whenever I do the setContentType, it is not actually switching it for me. Any ideas?
    CODE:
         protected void doGet(HttpServletRequest req, HttpServletResponse resp)
                   throws ServletException, IOException {
              PrintWriter w = resp.getWriter();
              String text;
              String path = null;
              text = map.getDocumentText(path);
                   System.out.println("BEFORE: Char Encoding");
                   System.out.println(resp.getCharacterEncoding());
                   System.out.println("BEFORE: Content Type");
                   System.out.println(resp.getContentType());
              resp.setContentType("text/html; charset=utf-8");
              resp.setCharacterEncoding("UTF-8");
              resp.setContentLength(text.length());
              w.write(text);
                   System.out.println("AFTER: Char Encoding");
                   System.out.println(resp.getCharacterEncoding());
                   System.out.println("AFTER: Content Type");
                   System.out.println(resp.getContentType());
    CONSOLE OUTPUT:
    BEFORE: Char Encoding
    ISO-8859-1
    BEFORE: Content Type
    null
    AFTER: Char Encoding
    ISO-8859-1
    AFTER: Content Type
    text/html;charset=ISO-8859-1

  • I need encoding='ISO-8859-1? in my xlm-file

    Hi
    Today I get <?xml version='1.0?> on top of my xml-file when using getXML() function in OracleXMLQuery. I need <?xml version='1.0' encoding='ISO-8859-1'?> instead.
    Any tip?
    /christer
    null

    You can't use System.out.println(). You need to use an output
    stream which is encoding aware (Ex.OutputStreamWriter). You can
    construct an outputstreamwrite and use the
    write(char[], int, int) method to print.
    Ex:
    OutputStreamWriter out = new OutputStreamWriter
    (System.out, "8859_1");
    /* Java enc string for ISO8859-1*/
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Hans Christian Pahlig (guest) wrote:
    : Dear all,
    : I've got some XML-Documents with encoding="iso-8859-1"
    : and try to parse this with xmlparser-1.0.1.4's
    : SAX API.
    : In characters( char[], int, int) I would like to
    : output the content in iso-8859-1 (Latin1) too.
    : With System.out.println() it doesn't work correctly.
    : German umlauts result in '?' in the output stream.
    : Internally ,w,,},Y,, are stored as
    : 65508,65526,65532,65476,65494,65500,65503 respective.
    : What do I have to do to get output in Latin1?
    : Host system here is a SPARC Solaris 2.6.
    : Thanks a lot,
    : HC
    null

  • Use encode ISO-8859-7

    Hi All,
         I'm new on this Forums and I want tell thanks to all for the help (I'm sorry if my english is not beatiful or correct)
         I'm using Flex on the last year and I have a web application for manage data arrive from file ASP.
         I need now to make a change on my application for read greek language. I set on my ASP the ISO for the language and all run well..
         But when I open a answer from ASP in Flex with mx:HTTPService the string on asp with greek symbol became in europe encode ISO-8859-1
         I try to change the setting of my pc to Greek but nothing change.
         Somebody know what is need to change for retrive this string in flex ?
         An other thing.. If I write in greek on a label in flex I saw the carachater without problem.
    Please help me
    Thank a lot for the helpand happy new year
    Danny

    b = GrammarText.getBytes(LastEncoding);
    String strTemp = new String(b,EncodingType);Here you take a String (which is in Unicode) and convert it to bytes, using "LastEncoding". Next you take those bytes and convert them back to a String, assuming that they were encoded using "EncodingType". But they weren't, so at best this will do nothing and at worst it will produce garbage. It certainly won't do anything useful.
    As I said all Java strings are in Unicode. If you want to convert something from one encoding to another encoding, you can only convert an array of bytes to a String using the first encoding, then convert that back to bytes using the second encoding. Converting a String to a String just makes no sense.

  • Cannot change charset from 'ISO-8859-1' to 'UTF-8' ?

    I've programed a web application with Facelets. As I start the first page "index.html" I got the following exception:
    "java.lang.IllegalStateException: Attempt to change ContentType after calling getWriter() (cannot change charset from 'ISO-8859-1' to 'UTF-8')"
    The header of the "index.html" looks as follow:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="refresh" content="0; url=./guess.jsf" />
    <title>Untitled Document</title>
    </head>
    What's wrong? Is it a bug of weblogic?

    same problem here with wl8.1
    have you sold it and if yes, how?
    thanks

  • PayloadZipBean and  file encoding ISO-8859-1

    Hi,
    I'm a scenario with a receiver file zipped in target side.
    I've tryed with
    Message protocol --> FILE
    Transfer mode --> binary
    File type --> TEXT
    FILE encoding --> ISO-8859-1
    and with StrictXml2PlainBean and  target file is correct.
    But when i add PayloadZipBean, then target file seems to be incorrect. When i try to unzip it, becames an error because of the zip file  seems to be created or transferred without the  appropriate BINARY mode .
    If I change file type to Binary, then zip file is correctly created, but  spanish characters are not correctly inserted when I unzip the file.
    How to solve this?
    Thanks, in advance,
    Carme

    This is a little bit tricky.
    check this blog:
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    You need two modules just for changing the encoding.

  • Encoding ISO-8859-1 does not work on linux machine

    Hi all
    I have an xsl with encoding ISO-8859-1 .So in this xsl I put special character like &#8364; that rappresent the Euro (money) symbol.
    So when I use that xsl on a window machine everithing is all right.When I use a Linux machine that code are not correctly mapped..
    Why?
    Help
    Regards

    actually I have a different mapping for �....on
    window it maps the space...on linux it maps A^....
    Any idea?How exactly are you determining that it is not working?
    Are you printing it to the screen? Are you using String.getBytes() and then printing the byte value? What are you doing?

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • Encoding ISO-8859-1 String

    I have a code, i want to decode iso88591string, but i got a $=�?=f?se;�rng;�?;�
    Is any sugestions how to convert iso8859-1 to windows 1257, Thanks
    public static void main(String[] args)
    String isoString= new String("$=�&#362;=f&#380;se;�rng;�&#379;;�");
    byte[] stringBytesIso;
         try
              stringBytesIso = isoString.getBytes("ISO-8859-1");
                   String utf8String = new String(stringBytesIso, "windows-1257");
                        System.out.print(stringBytesIso+" "+utf8String);
         catch (UnsupportedEncodingException e) { e.printStackTrace();}
    }

    Were you expecting Java to magically convert "&#362;" into some character?
    Doesn't work that way.I agreed. What you need is a diacritic mapping. Unfortunately, there's no easy way of doing the mapping.
    on solution is to have a HashMap where
    key = character above 256
    value=similiar character to Window ASCII extended
    anything less than 256, you don't need to convert
    also, looks for patterns to reduce the diacritic mapping hashmap.

  • British Pound Sterling with UTF-8 and ISO-8859-15

    Please excuse my long-windedness ... I'm simply trying to answer all possible questions up front and give the most possible information. I've searched through tons of forums and all over various sites and references and am not able to come up with a concrete solution to this. I'd appreciate any help anyone has.
    I'm having some trouble with character sets and international currencies.
    Our server was recently upgraded from Red Hat 7.3 to Red Hat 8.0. I understand that the default system encoding thus changed from ISO-8859-15 to UTF-8. I have verified this by executing the following:
    public class WhichEncoding {
      public static void main(String args[])
        String p = System.getProperty("file.encoding");
        System.out.println(p);
    }I have two machines, one which represents the old system (7.3) and one representing the new (8.0), which I will call machine73 and machine80 respectively.
    [machine73:~]# java WhichEncoding
    ISO-8859-15
    [machine80:~]# java WhichEncoding
    UTF-8I have also verified that the JVM is using the correct default character set by executing the following:
    import java.io.ByteArrayOutputStream;
    import java.io.OutputStreamWriter;
    public class WhichCharset {
        public static void main (String[] args) {
            String foo = (String)(new OutputStreamWriter(new ByteArrayOutputStream())).getEncoding();
            System.out.println(foo);
    }which yields:
    [machine73:~]# java WhichCharset
    ISO-8859-15
    [machine80:~]# java WhichCharset
    UTF8Here comes the problem. I have the following piece of code:
    import java.text.NumberFormat;
    import java.util.Locale;
    public class TestPoundSterling
        public static void main (String[] args)
            NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale("en", "GB"));
            System.out.println(nf.format(1.23));
    }When I compile and execute this, I see mixed results. On machine73, I see what I would expect to see, the British Pound Sterling followed by 1.23. To be sure, I outputted the results to a file which I viewed in a hex editor, and observed [A3 31 2E 32 33 0A], which seems to be correct.
    However, when I execute it on machine80, I see a capital A with a circumflex (carat) preceding the British Pound Sterling and the 1.23. The hex editor shows [C2 A3 31 2E 32 33 0A].
    I looked up these hexadecimal values:
    Extended ASCII
    0xC2 = "T symbol"
    0xA3 = lowercase "u" with grave
    ISO-8859-1
    0xC2 = Capital "A" with circumflex (carat)
    0xA3 = British Pound Sterling
    Unicode Latin-1
    0x00C2 = Capital "A" with circumflex (carat)
    0x00A3 = British Pound Sterling
    (This explains why, when I remove /bin/unicode_start and reboot, I see a "T symbol" and "u" with a grave in place of what I saw before ... probably an irrelevant sidenote).
    I found a possible answer on http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 under the Examples section. Apparently, a conversion between Unicode and UTF-8 acts differently based on the original Unicode value. Since the Pound Sterling falls between U-00000080 � U-000007FF (using the chart on the mentioned site), the conversion would be (as far as I can tell):
    U-000000A3 = 11000010 10101001 = 0xC2 0xA3
    This appears to be where the extra 0xC2 pops up.
    Finally, to the whole point of this: How can I fix this so that things work as they should on machine80 like they did on machine73. All I want to see at the command line is the Pound Sterling. Getting the 0xC2 preceding the Pound Sterling causes some parts of my applications to fail.
    Here's some additional information that might be of use:
    [machine73:~]# cat /etc/sysconfig/i18n
    LANG="en_US.iso885915"
    SUPPORTED="en_US.iso885915:en_US:en"
    SYSFONT="lat0-sun16"
    SYSFONTACM="iso15"
    [machine73:~]# echo $LANG
    en_US.iso885915
    [machine80:~]# cat /etc/sysconfig/i18n
    LANG="en_US.UTF-8"
    SUPPORTED="en_US.UTF-8:en_US:en"
    SYSFONT="latarcyrheb-sun16"
    [machine80:~]# echo $LANG
    en_US.UTF-8Any help is very, very much appreciated. Thanks.

    you didn't look hard enough, this is a faq...
    there three options:
    1) change the system encoding by setting LANG or LC_CTYPE environment variables... assuming you use bash:bash$ export LC_CTYPE=en_GB.iso88591 you can check the available locales with locale -a ... pipe it to grep en_GB to filter out the non-british english locales
    -OR-
    2) change the java default encoding from the command line with -Dfile.encoding... run with$ java -Dfile.encoding=ISO-8859-1 yourclass-OR-
    3) set the encoding from within the program with OutputStreamWriter, or use a PrintStream that has the encoding set..PrintStream out = new PrintStream(new FileOutputStream(FileDescriptor.out), true, "ISO-8859-1");
    System.setOut(out);see also the internationalization tutorial & the javadoc of the related classes....

  • XML Encoding Issue - Format UTF-16 to ISO-8859-1

    Dear Groupmates,
    I have data in my Internal table which i am converting to XML using custom Transformation.
    Data is going to third party.The third party system requires data in ISO-8859-1 Format but SAP is generating the same in UTF-16 Format.I have been able to change the format of file from
    utf-16 to ISO-8859-1 format but after conversion i am getting invalid tag information in form of characters
    like &lt , &gt etc..in my file.
    Here is the code i have used to set the encoding to ISO-8859-1 :-
    DATA: xmlout TYPE xstring.
    DATA: ixml TYPE REF TO if_ixml,
    streamfactory TYPE REF TO if_ixml_stream_factory,
    encoding TYPE REF TO if_ixml_encoding,
    ixml_ostream TYPE REF TO if_ixml_ostream.
    ixml = cl_ixml=>create( ).
    streamfactory = ixml->create_stream_factory( ).
    ixml_ostream = streamfactory->create_ostream_xstring( xmlout ).
    encoding = ixml->create_encoding(
    character_set = 'ISO-8859-1' byte_order = 0 ).
    ixml_ostream->set_encoding( encoding = encoding ).
    Sample Output :-
    <?xml version="1.0" encoding="iso-8859-1"?>
    <AMS_DOC_XML_EXPORT_FILE><AMS_DOCUMENT AUTO_DOC_NUM="FALSE" DOC_CAT="CA" DOC_CD="CA" DOC_DEPT_CD="045" DOC_ID="XR10281060830400001" DOC_IMPORT_MODE="OE" DOC_TYP="CH" DOC_UNIT_CD ="NULL" DOC_VERS_NO="01">
    <CH_DOC_HDR AMSDataObject="Y">
    <DOC_CAT Attribute="Y">&lt;![CDATA[CA]]&gt;</DOC_CAT>
    <DOC_TYP Attribute="Y">&lt;![CDATA[CH]]&gt;</DOC_TYP>
    Please let me know if anyone has idea how i can get rid of the invalid tag information.
    Thanks !
    With Regards,
    Darshan Mulmule

    Darshan,
    Did you get an answer for this question? We have same requirement to create XML file in ISO-8859-1 format with Attributes is set to "Y" and CDATA is being used for data.
    Can you please let me know if you still remember how did you achieve it?
    Satyen...

  • Changing character encoding in ps xml pub. from utf-8 to iso-8859-1

    I am using xml publisher to generate a report in a pdf format, now my problem is user has entered a comment which is not supported by utf but in iso-8559-1 its working fine,
    I tried to change the encoding in people code, xml doc file ,schema and xliff file but still the old formatting exist,should I change somewhere else.
    Following the error i get when trying to generate pdf:"Error generating report output: (235,2309)Error occurred during the process of generating the output file from template file, XML data file, and translation XLIFF file.".The parser is not able to recognise with utf-8 encoding.

    I had the same issue. I created the xml through rowset and used string substitute function and its working.
    Sample:
    &inXMLDoc = CreateXmlDoc("");
    &ret = &inXMLDoc.CopyRowset(&rsHdr);
    &sXMLString = &inXMLDoc.GenFormattedXmlString();
    &sXMLString = Substitute(&sXMLString, "<?xml version=""1.0""?>", "<?xml version=""1.0"" encoding=""ISO-8859-1""?>");
    hope this helps!
    GN.

  • 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.

    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.

Maybe you are looking for

  • Error in running jsp file which contains inner class,help !

    Environment ias sp4 for windows2000 Error: try to access class jsp.APPS.bsteelWZ.order.OrderMgmtMain$1$sOrderHelper from class jsp.APPS.bsteelWZ.order.OrderMgmtMain OrderMgmt.jsp contains a class named sOrderHelper. It's all ok on ias sp2 for solaris

  • Download Header using GUI_DOWNLOAD for more than 100 fields

    Hi, I want to download data with header from a database table using the FM 'GUI_DOWNLOAD'. I know that this can be achieved by 1. Download headers first to an internal table and call FM ' GUI_DOWNLOAD"  2. then Download data to the same file by calli

  • DefaultServlet?

    I've figured out how to manipulate the welcome-file-list tag in web.xml for tomcat to bring up the desired web page if someone hits my site without specifying a page (e.g. www.mysite.com will take them to www.mysite.com/index.html). But, my index pag

  • Problem after moving pix between rolls

    Let me say up front that I know I should be using albums to organize pix. And that's what I'll do from now onn. But I could use some suggestions for dealing with this. Dragged and dropped some pix from one roll - call it Roll A - to another, Roll B.

  • Migration tool from AD LDS to AD 2008

    Hello, In my enterpise we need to migrate Users and Groups from AD LDS (1 instance with OS : Windows 2008 R2) to AD 2008. I can do that with LDIFDE but we have to migrate the user password also (LDIFDE can't extract the userpassowrd). Is there a tool