How to set encoding

Hi!
How do I set the encoding in an xml-file?
I'm using the DocumentBuilder to create a Document and adds data to the DOM tree. Then I'm using a Transformer to write the DOM tree to a stream.
The default encoding is UTF-8. I want to change this to iso-8859-1. How do I do that?
Thanks,
Fredrik

Transformer transformer = null;  // initialize in a spiffy way
transformer.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");- Saish

Similar Messages

  • SDIXML_DOM_TO_XML - How to set Encoding - ANSI

    Hi,
    I am using SDIXML_DOM_TO_XML to generate XML File.
    I am using the method 'set_encoding' of IF_IXML_DOCUMENT
    to set the encoding format for the document.
    How to set the encoding format as ANSI for the document?
    Thanks & Regards,
    Abhishek

    also,
    I am trying to write the XML file to file in app.server.

  • How to set Encoding in ABAP Mapping

    Hi All,
    I have implemented ABAP Mapping in XI for converting Idoc into Idoc Flatfile which is provided by SAP and is in the below link.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    However after this mapping is taking place all chinese characters are being replaced by #.
    So i want to explicitly set encoding in this ABAP Mapping. Can anybody please tell me where to set Encoding and how in this ABAP Code?
    Regards,
    Dinakar

    Any help please. Urgent.
    Regards,
    Dinakar

  • How to set encoding for xml Marshaller?

    Hi,
    I am using SAPXMLToolkit. And I use XMLMarshaller to convert from xml to java classes (jaxb classes). Now when I get some characters like ü, the marshaller gives an error
    com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 69(:main:, row:1, col:323)
         at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:207)
         at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:205)
         at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.read(AdvancedXMLStreamReader.java:152)
         at com.sap.engine.lib.xml.parser.XMLParser.scanCharData(XMLParser.java:1896)
         at com.sap.engine.lib.xml.parser.tokenizer.XMLTokenReaderImpl.next(XMLTokenReaderImpl.java:190)
    How do I solve this?? How do I set encoding for the marshaller?
    Regards,
    Guru

    Hi ogre,
    To set the encoding scheme for an XML document, you can use the createProcessingInstruction. Our CVIXML instrument driver (which
    is basically and user-friendly wrapper made around the MSXML interface) uses
    this method to specify the version of the XML document. So, what you could do
    is simply modify our existing CVIXML instrument driver to include the encoding.
    It's actually quite simple to do this.
    First off, open up the cvixml.c file
    located in the <CVI>\toolslib\toolbox directory in CVI. Then change the
    value of the constant XML_PROC_INSTR_DATA
    (located on line 42) from "version=\"1.0\"" to "version=\"1.0\"
    encoding=\"UTF-8\"". The save your source file and
    select Options >> Create Object file. This object file
    (cvixml.obj) is attached to your cvixml.fp function panel. 
    To test this out, you could simply use some code like
    CVIXMLNewDocument ("RootElement", &xmlDoc);
    CVIXMLSaveDocument (xmlDoc, 0, "C:\\Test.xml");
    Then the Test.xml document should say
    <?xml version="1.0" encoding="UTF-8"?>
    <RootElement/>
    Hope this helps!
    Best Regards,
    Jonathan N.
    National Instruments

  • How to set encoding  with xmldom ?

    Hello !
    I have to build an xml file from a query.
    I need to have : <?xml version="1.0" encoding="ISO8859-1"?> on the first line.
    I know how to set the version --> xmldom.setVersion(doc,'1.0'); ... but I don't know how to set the encoding.
    Is there a way to set it ?
    Thanks

    No. It is not possible. Here is an extract of a document I found on metalink :
    (XML Parser for PL/SQL FAQs)
    Q: Is it possible to dynamically set the encoding in the XML document?
    A: No, you must include the proper encoding declaration in your document, as
    per the specification. You cannot use setCharset(DOMDocument) to set the
    encoding for the input of your document. SetCharset(DOMDocument) is used
    with oracle.xml.parser.v2.XMLDocument to set the correct encoding for
    printing of the document.

  • How to set encoding in Apex Listener

    I have a problem conversion characters when using Apex listener
    The problem occurs in two different configurations:
    1. APEX Listener 2.0 running on GlassFish Server Open Source Edition 4.0 Oracle Database 11g Release 11.2.0.3.0 (NLS_LANGUAGE: AMERICAN, NLS_CHARACTERSET: AL32UTF8)
    2 . APEX Listener 2.0 running in standalone mode Oracle Database 10g Express Edition Release 10.2.0.1.0 (NLS_LANGUAGE: AMERICAN, NLS_CHARACTERSET: AL32UTF8)
    to demonstrate the problem I created a restful service, which is in the GET method returns the result of the query :
    select: p_param as "result" from dual
    parameter : p_param transmitted via http header
    parameter : p_param set to 'sample data дф ' , the last two characters - Cyrillic
    Http Request is as follows:
    GET http://xxx.xx.xxx.xxx:8080/apex/encode HTTP/1.1
    Accept-Encoding: gzip, deflate
    param: sample data дф
    Host: xxx.xx.xxx.xxx: 8080
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
    in both cases, the return value - <result> sample data 4D </ result>
    I could not find documentation on how to avoid re-encoding?
    regards.

    With a WE8MSWIN1252 (or comparable charset) database, fronted by APEX listener, and the absense of NVARCHAR2 support in APEX, is there an option to build an APEX application supporting UTF-8 characters anyway, without converting the whole database to UTF-8?
    As "Application Builder User’s Guide" is quite tight-lipped when it comes to UTF-8 support, can somebody recommend an APEX FAQ concerning UTF-8 support in APEX?
    Thanks and regards, Tom

  • How to set encoding of the file when using UTL_FILE

    Hi,
    We are using HRMS 11i applications. 11.5.10.2 version. Two languages are installed in our instance. American English and Canadian French.
    We have requirement to send employee details in a text file to third party vendor. We are using UTL_FILE to write details to the text file from PL/SQL procedure.
    The generated output file has encoding as "UTF8". Where as vendor is not able to process this file. They required encoding as "ANSI".
    How can we change the encoding to "ANSI" ?
    Values of character set parametrs are as follows.
    NLS_CHARACTERSET UTF8
    NLS_NCHAR_CHARACTERSET UTF8
    Any inputs are highly appreciated.
    Regards,
    Veerababu.

    You should take a look at the UTL_FILE documentation. As far as I know standard UTL_FILE calls write to the file system in the database character set. There are mirrored calls, but those write to the file system in UTF8.
    You may want to look at the UTL_RAW.CONVERT function. You may be able to use that in conjunction with the UTL_FILE.PUT_RAW API to write out data in the correct character set. To be honest, I've never tried this approach.
    Edited by: Centinul on Sep 21, 2012 8:16 AM

  • How to set encoding in XMLGen

    I need to have an XML doc generated from the server with the encoding set to Big5.
    I just was looking at the XMLGen utilties to replace our own PL/SQL procedures for generating XML from a query. However I can't see any option to specify the encoding.
    Does anyone know how to do this.
    Rob
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rob Edgar:
    I need to have an XML doc generated from the server with the encoding set to Big5.
    I just was looking at the XMLGen utilties to replace our own PL/SQL procedures for generating XML from a query. However I can't see any option to specify the encoding.
    Does anyone know how to do this.
    Rob
    <HR></BLOCKQUOTE>
    XMLGEN.SETENCODINGTAG('ISO-8859-P1');
    will do this for the output XML data. You must specify the charater set based on the NLS_LANG environment variable/registry setting to match this tag.
    I used TOAD to look at the SYS.XMLGEN package definition to see extra info on this utility. You should be able to do the same using the ALL_SOURCE view from SQL*Plus.
    null

  • How to set encoding for Web-To-Go??

    When the first launch of the Mobile Server (webtogo), there's a line showing the conversion for the charset encoding, like from MS950 to BIG5 for Chinese windows. Now I'm facing a problem where I need the encoding be UTF-8. Could someone please tell me where can I set this? Thank you very much for your help.

    Hi Celine,
    As I know, 1st your Oracle DB char set should be UTF8. 2nd Char set convertion is process in JAVA program.
    Regards
    Nicholas

  • How to set encoding windows-1251 in Apex Listener?

    How to display in browser xml in windows-1251. Trying
    begin
         owa_util.mime_header ('text/xml', TRUE, 'windows-1251');
         htp.p ('<?xml version="1.0" encoding="windows-1251"?>');
         htp.p ('<test>Тест</ test>');
    end;
    In the header Content-type: text/xml; charset=utf-8
    and the body in the utf-8 encoding

    Hi all
    Iam using apex 4.0 -oracle 11g with OHS on linux os
    I need to change my apex url http://x.x.x.x:xxxx/apex to http://x.com
    What are the settings i need to do.
    If any one knows please share the solution with me
    Thanks & In advance

  • How to set encoding type for e4x result

    I have a application with front end Flex and Server side App
    in Java. I am using HttpService to communicate to Java application
    (Web). I am sending data in xml format to flex and parsing it as
    e4x format. From service side I am setting the charset as
    windows-1252 and xml encoding is also windows-1252. In Flex I am
    getting some junk characters. But When I post the same http request
    from browser, I am able to view the characters with expected
    encoding.
    Can anybody clue me on getting xml data in required encoding
    type (charset) in Flex.
    Thanks in Advance,
    Gokul Ram.T

    The message is old, but the problem is opened and I believe that many people have troubles with getting appropriate encoding in e4x result.
    I have excactly same problem like Gokul, only difference is that I am trying to get ISO-8859-2 charset. HttpService deffinition looks like this:
    var source:HTTPService = new HTTPService();
    source.method = "POST";
    source.resultFormat = "e4x";
    source.contentType = "text/xml; charset=ISO-8859-2";
    source.headers = {"Content-Type": "text/xml; charset=ISO-8859-2"};
    So I suppose that everything what can be set is set. But still in result XMLthere are no national chars. I also get correct XML when I request it in browser, but requesting by Flex and HttpService makes problem.
    Does anyone have same problem and find out something to handle this?

  • How to add a new character set encoding?

    Hello,
    can anybody please explain to me, how to add a new character set encoding to Mac OS Tiger?
    I have two Mac laptops, a new one with Snow Leopard and an older one with Tiger, and on the old one i cannot use or enable anywhere the "Russian (DOS)" character set encoding, which i need to be able to use some old text files.
    On the Snow Leopard, this encoding is present in the list of available encodings of TextWrangler, but not in TIger.
    If i have understood correctly, this is not a problem of TextWrangler, and the same encodings are available systemwide.
    So, the question is: how to add new encodings to Tiger (or to Mac OS in general)?
    Thanks.

    I think possibly that's in the Get Info window of Finder?
    I don't think either that or the input menu have any effect on available encoding choices. Adding languages to system prefs/international/languages can do that, but once you have added Russian there, I don't know of any way to add an additional Russian encoding (there are quite a number of them).

  • How to set(add) an e-mail encoding option in iPod Touch Mail?

    Hi.
    When I'm sending multi language e-mail in my iPod, it is shown in my desktop below.
    ?섏씠
    ?섏쓽 iPod?먯꽌 蹂대깂
    2009. 04. 06 ?ㅽ썑 6:16 "Kwansu Lee" <[email protected]> ?묒꽦:
    But I can read in Outlook2007, if I set encoding options as UTF-8.
    하이
    나의 iPod에서 보냄
    2009. 04. 06 오후 6:16 "Kwansu Lee" <[email protected]> 작성:
    It has no character set like
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    How can I send an e-mail in my iPod without multilanguage encoding problem?
    Message was edited by: leesof

    I opened e-mail in IE Browser, I can get encdoing type like below.
    MIME-Version: 1.0
    Content-Type: multipart/alternative;
    boundary="----=NextPart_000_019C01C9B765.4C8DA160"
    여러 부분으로 구성된 MIME 형식의 메시지입니다.
    ------=NextPart_000_019C01C9B765.4C8DA160
    Content-Type: text/plain;
    charset="euc-kr"
    Content-Transfer-Encoding: 8bit
    ------=NextPart_000_019C01C9B765.4C8DA160
    Content-Type: text/html;
    charset="euc-kr"
    Content-Transfer-Encoding: quoted-printable
    What program produced that email? iPod? The one you sent me had two different charsets.
    I wrote a html e-mail in Outlook, and a plain text e-mial in my iPod.
    I think It's mismatch in character set and contents. Is it right?
    Sorry, but I can't understand what you are referring to. You sent me a message from your ipod. It had two different charsets. That is not a bug. Outlook does have a bug which makes it misread messages with two different charsets. Apple could accomodate that bug by having the ipod use the same charset instead of two different ones, and that is the easiest fix, because MS makes garbage software and never fixes its bugs.

  • How to set DB driver's encoding ??

    I'm currently using Access 2000 with tomcat as server. My problem is how to set the database's encoding in java ?? for both read and write ?? I'm trying to storea strings from the JSP in UTF-8 format in to access but as I retrieve it from database it has a lot of "???" I have the unicode support turned on but still no use, can anyone please help ~ thank you

    Hi.
    Read documentation on JDBC driver that you use to connect to MS Access database.
    Victor Letunovsky

  • How to use set_encoding method to set encoding in ABAP Mapping

    Hi All,
      Can anyone please let me know how to use set_encoding method in ABAP Mapping to set encoding.
      Any help would be greatly appreciable.
    Regards,
    Dinakar

    Hi Stefan,
    Thanks for your info. Let me try in ABAP Forum.
    Regards,
    Dinakar

Maybe you are looking for