Incorrect UTF-8 encoded date in XML reports under German Win in March (IE error)

TestStand XML reports are marked as UTF-8 encoded. But those reports generated under Win2k German in March (written as "März" in German) cannot be displayed in the Internet Explorer because the umlaut character of the month name is not correctly UTF-8 encoded.

Hi
I have attached the modified modelsupport2.dll and the ReportGen_Xml.seq which fixes the problem. I also attached the modified report.c and modelsupport2.fp files.
If you have not made changes to modelsupport2.dll and reportgen_xml.seq you can add the modified files to \Components\User\Models\TestStandModels\ folder and the TestStand engine should use the version under the user folder.
If you have made changes to ReportGen_Xml.seq and ModelSupport2.dll then you will need to move the changes in the below files to the files under the User folder.
FYI: If you want to create a new component or customize a TestStand component, copy the component files from the NI subdirectory to the User subdirectory before customizin
g. This ensures that installations of newer versions of TestStand do not overwrite your customization. If you copy the component files as the basis for creating a new component, be sure to rename the files so that your customization do not conflict with the default TestStand components.
The TestStand Engine searches for sequences and code modules using the TestStand search directory path. The default search precedence places the \Components\User directory tree before the \Components\NI directory tree. This ensures that TestStand loads the sequences and code modules that you customize instead of loading the default TestStand versions of the files.
I hope this helps.
Regards
Anand Jain
National Instruments.
Attachments:
ModifiedFiles.zip ‏384 KB

Similar Messages

  • How to get UTF-8 encoding when create XML using DBMS_XMLGEN and UTL_FILE ?

    How to get UTF-8 encoding when create XML using DBMS_XMLGEN and UTL_FILE ?
    Hi,
    I do generate XML-Files by using DBMS_XMLGEN with output by UTL_FILE
    but it seems, the xml-Datafile I get on end is not really UTF-8 encoding
    ( f.ex. cannot verifying it correct in xmlspy )
    my dbms is
    NLS_CHARACTERSET          = WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET     = AL16UTF16
    NLS_RDBMS_VERSION     = 10.2.0.1.0
    I do generate it in this matter :
    declare
    xmldoc CLOB;
    ctx number ;
    utl_file.file_type;
    begin
    -- generate fom xml-view :
    ctx := DBMS_XMLGEN.newContext('select xml from xml_View');
    DBMS_XMLGEN.setRowSetTag(ctx, null);
    DBMS_XMLGEN.setRowTag(ctx, null );
    DBMS_XMLGEN.SETCONVERTSPECIALCHARS(ctx,TRUE);
    -- create xml-file:
    xmldoc := DBMS_XMLGEN.getXML(ctx);
    -- put data to host-file:
    vblob_len := DBMS_LOB.getlength(xmldoc);
    DBMS_LOB.READ (xmldoc, vblob_len, 1, vBuffer);
    bHandle := utl_file.fopen(vPATH,vFileName,'W',32767);
    UTL_FILE.put_line(bHandle, vbuffer, FALSE);
    UTL_FILE.fclose(bHandle);
    end ;
    maybe while work UTL_FILE there is a change the encoding ?
    How can this solved ?
    Thank you
    Norbert
    Edited by: astramare on Feb 11, 2009 12:39 PM with database charsets

    Marco,
    I tryed to work with dbms_xslprocessor.clob2file,
    that works good,
    but what is in this matter with encoding UTF-8 ?
    in my understandig, the xmltyp created should be UTF8 (16),
    but when open the xml-file in xmlSpy as UTF-8,
    it is not well ( german caracter like Ä, Ö .. ):
    my dbms is
    NLS_CHARACTERSET = WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET = AL16UTF16
    NLS_RDBMS_VERSION = 10.2.0.1.0
    -- test:
    create table nh_test ( s0 number, s1 varchar2(20) ) ;
    insert into nh_test (select 1,'hallo' from dual );
    insert into nh_test (select 2,'straße' from dual );
    insert into nh_test (select 3,'mäckie' from dual );
    insert into nh_test (select 4,'euro_€' from dual );
    commit;
    select * from nh_test ;
    S0     S1
    1     hallo
    1     hallo
    2     straße
    3     mäckie
    4     euro_€
    declare
    rc sys_refcursor;
    begin
    open rc FOR SELECT * FROM ( SELECT s0,s1 from nh_test );
    dbms_xslprocessor.clob2file( xmltype( rc ).getclobval( ) , 'XML_EXPORT_DIR','my_xml_file.xml');
    end;
    ( its the same when using output with DBMS_XMLDOM.WRITETOFILE )
    open in xmlSpy is:
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <S0>1</S0>
    <S1>hallo</S1>
    </ROW>
    <ROW>
    <S0>2</S0>
    <S1>straޥ</S1>
    </ROW>
    <ROW>
    <S0>3</S0>
    <S1>m㢫ie</S1>
    </ROW>
    <ROW>
    <S0>4</S0>
    <S1>euro_€</S1>
    </ROW>
    </ROWSET>
    regards
    Norbert

  • Dynamic change of PropFlags_IncludeInReport doesn't change data in XML report

    Hi,
    I have tried to change the contents of my XML report generated in TS3.1 by changing the PropFlags_IncludeInReport. This works for some simple data types like numericteststep where I have removed the limits and step result from the report if the step pass. This is done from LV7.1 where I have created a reference to the step properties and then changed the flag with the GetFlag Property and SetFlag Property. I have posted a HTML (easier to open remote) example “MIGAExcludePassStepLimitsFromHTML.html” & a picture that shows the step structure “NumTestStepStructure.jpg”.
    But it doesn’t work when my data type is getting more complicated. See CustomTestStepStructure.jpg. In this case it’s an array of containers (measurement - custom data type) that contains some containers (limits and channel – custom data type). I have removed the PropFlags_IncludeInReport on all the custom data types (in the top of the tree) except on some of the items in the last type in the tree (Status, Read.Voltage_V, Limits.Voltage_High_V, Limits.Voltage_Low_V…).
    The XML style sheets doesn’t show my data when I remove the PropFlags_IncludeInReport of the Measurement Array (if it’s on all the sub-properties are shown. Not wanted because off the size). I assume it’s a bug (shows data in HTML) if some data in the structure has this flag enabled?
    I can see in the source of the XML report that the flags are added to each property. These flags have the correct value from the custom data type, but the style sheets can’t show them correctly. It’s possible that NI will make a fix to this problem?
    I have also tried to change the PropFlags_IncludeInReport on my custom step properties from LV7.1 like above. But my changes of the flags dynamically aren’t included in my XML report (new flags aren’t added to each property). Why? Is it because of the data type? Is it because I do it in a Post Step? Is there a solution?
    I am looking forward to hear from you,
    Best Regards,
    Morten Pedersen
    CIM Industrial Systems A/S

    Hi,
    I have posted some sequences for you. Extract to C:\. The only difference in these seq-files is the PropFlags_IncludeInReport flag for the Result.Measurement property in the custom step type called MIGA_DCPower_HM7044.
    Try to run the sequences. With XML report enabled. In the beginning of the CimHamegTest_MainTestSequence there are some numeric limit test step that in the run code enables or disables, with the SetFlag Method, the result, limits and comp depending on the test pass or fail. Works fine.
    But there are problems in my custom step types that are executed after. The different sequence files shows the first problem. If the Flag mentioned in the top is disabled no sub data is include besides their flags is set to IncludeInReport. In the source code of the XML the flags are correct, but the stylesheet can’t show them.
    The second problem is when I tried to change the flag dynamically. This is done in a post step for the custom step type called MIGA_DCPower_HM7044. This vi disables all the low voltage limits. I use for e.g. this look up string for that: Step.Result.Measurement[0].Limits.Voltage_Low_V. These changes aren’t included in my report. Both the HTML and XML would not show or change it.
    I hope this will show you the problems and hopefully help me.
    Best regards,
    Morten Pedersen
    CIM Industrial Systems A/S

  • Incorrect localization wrap-up data in Historical Reports

    When we add wrap-up data in Cisco Desktop Work Flow Administrator everything is correct.
    When we load Agent Wrap-up Data Summary Report we get the discrepancy coding.
    UCCX 8.5 Russian

    Hi Mauro,
    Please refer the "Table 2-36 EEMQueueAgentDetail Table Fields" in the below link,
    http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/crs/express_7_0/user/guide/uccx70dbschema.pdf
    wrapupData
    Wrapup selected by agent when email is terminated.
    You can use SQL queries (am not good at it) to fetch these values.
    Thanks,
    Anand
    Please rate helpful posts !!

  • Data filtering in XML report with out changing the underlying query

    Hi, This is Nagesh and from Verizon.
    I'm testing Query based XML report in Peoplesoft 9.1 app with tools version 8.5.
    I'm trying to filter the data on XML Report template with out changing the underlying PS query. I mean filter the data on the report to only specific accounts though the underlying PS query query return transactions booked to all Accounts for a given Legal Entity. Is it possible. any advise or idea is highly appreciated.
    Thanks
    Ages

    If the value is not of importance how come it became obligatory in your program?
    Any how you can do one thing...Put some value in your obligatory field, put a debugger point where you are interested in  and use the pencil tool to change the value of the field while debugging. 
    Regards,
    Philip.

  • Displaying HTML data in the xml report

    hi
    can anybody help me out on how to display the HTML data in XML report, for example the data in the table is in the following format with HTML tags attached to it
    *&lt;b&gt;Test Good display as normal text&lt;b&gt;*
    +&lt;i&gt;Test Italicized &lt;i&gt;+
    i would like to display the above data in the XML report as a following with "Test Good display as normal text" as BOLD and "Test Italicized" as Italicized
    Test Good display as normal text Test Italicized
    if anybody came across similar issue please help me out.
    Regards
    Hemi.

    Hi..
    Check out this link..hope this helps..
    http://blogs.oracle.com/xmlpublisher/2007/01/formatting_html_with_templates.html

  • UTF-8 encoding vs ISO 8859-1 encoding

    The iTunes tech specs call for UTF-8 encoding of the XML feed file; a friend of mine uses feed generator software through his blog that uses ISO 8859 encoding. Is there a way to convert the latter to UTF-8 so that iTunes tags may be successfully added?
    When I tried editing his XML file, I got error messages when I submitted the file to RSS feed validator sites (such as http://feedvalidator.org/. Any help or knowledge is appreciated because I am not the least bit expert in this coding arena.

    You don't need to convert iso 8859-1 (us-ascii) to utf-8 unless you have nonstandard characters. Basically, ascii is a subset of utf-8 and for English it will serve you just fine. You can have iTunes tags in the xml file even if the file itself is encoded in iso 8859-1.
    The error you see at feedvalidator.org is most likely a warning.
    Hope this helps!
    - Andy Kim
    Potion Factory
    http://www.potionfactory.com

  • OPP error in XML reports

    Hi all,
    If we run XML reports its running fine.But, sometimes following errors occured.
    *****Beginning post-processing of request 2139021 on node ORMDV114 at 23-MAR-2008 15:14:11.
    Post-processing of request 2139021 failed at 23-MAR-2008 15:14:11 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.******
    Please provide solution for this issue.
    We got this error frequently.But, we are not able to solve this error.
    Thanks

    Did you get it while creating a template from the Word-Addin? Just close MS Word and then log back in and see whether it works. If you are on 10.1.3.2 then go to Start->Program Files->Oracle Business Intelligence -> Template Builder for Word and set the language to en-US. Your error could be because of a MS patch. If you set the language that should make it work.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Jdev 10.1.2 data-sources.xml weirdness

    Hi, I am using JDeveloper 10.1.2 with all the updates.
    My project is a web service. I'm getting a database connection like this:
    InitialContext ic = new InitialContext();
    DataSource ods = (DataSource) ic.lookup("jdbc/PeopleSoftPooledDS");
    Connection conn = ods.getConnection();I find that I cannot do "Oracle" things with the connection; in debug I find out that its not an Oracle connection. Its com.evermind something. I'm trying to figure out why, and how to get an Oracle driver connection.
    No data-sources.xml files under my jdeveloper install reference the evermind driver now. Yet I'm still getting an evermind connection.
    I can't seem to figure out what is going on
    Dennis S

    The class name is defined as oracle.jdbc.pool.OracleConnectionCacheImpl. The connection driver is defined as oracle.jdbc.driver.OracleDriver.
    By not being able to do "Oracle" things with the connection I mean method calls. I did a stmt.execute() and couldn't do a stmt.getCursor() because stmt wasn't an Oracle object.

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

  • Image encoding in XML report definition

    For a number of reports I have the Report definition in XML-format. These files contain embedded images.
    How do I extract image-files from the xml's. It doesn't look like the strings for the images are not base16 or base64 encoded?

    Are you working with something like this?
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <report name="MODULE1" DTDVersion="9.0.2.0.10">
      <xmlSettings xmlTag="MODULE1" xmlPrologType="text">
      <![CDATA[<?xml version="1.0" encoding="&Encoding"?>]]>
      </xmlSettings>
      <data>
        <systemParameter name="MODE" initialValue="Default"/>
        <systemParameter name="ORIENTATION" initialValue="Default"/>
      </data>
      <layout>
      <section name="main">
        <body>
          <image name="B_1">
            <geometryInfo x="0.00000" y="0.00000" width="8.31250" height="6.25000"
            />
            <visualSettings fillPattern="transparent" fillBackgroundColor="black"
             linePattern="transparent" lineBackgroundColor="black"/>
            <points>
              <point x="0.00000" y="0.00000"/>
              <point x="8.31250" y="6.25000"/>
              <point x="0.00000" y="0.00000"/>
              <point x="8.31250" y="6.25000"/>
            </points>
            <binaryData encoding="hexidecimal" dataId="image.B_1">
    FF8DFF0E 0001A464 94640010 10100006 00060000 FFBD0048 0001B0C0 E0C0A001
    E0D0E021 11013181 82A18161 61811332 52D182A3 33D3C393 33837304 84C5E404
    44755473 8305D615 75F52676 8676E3D4 17970746 87C55676 36101121 21815181
    F2A1A1F2 36248324 36363636 36363636 36363636 36363636 36363636 36363636
    36363636 36363636 36363636 36363636 36363636 36363636 3636FF4C 102A0000
    D29681A8 4EB94557 F3D8D588 912F1FCE A2478278 4E157FE8 D3B2F257 A1906D14
    A809D102 9F646EFF 007CA66A B08C98EF 2E5344BB 4978EEAD 55093F75 6A4E8D29
    345ECCA0 4F537A2C 9CB424CB 8DDE0D7D 53D4D002 D3E32E6D 1942F70F 5D29740C
    7CF15A56 1A469E72 F449A09D 918DE7CF 5F9F877A 17106FEF 474C484E 6F41C067
    0D1338AF 1D06311A 4E6608F0 F4C40540 859FBFE7 579924E1 495C31FF 9D
            </binaryData>
          </image>
        </body>
      </section>
      </layout>
      <webSource>
      <![CDATA[<%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp" session="false" %>
    <%@ page contentType="text/html;charset=ISO-8859-1" %>
    <!--
    <rw:report id="report">
    <rw:objects id="objects">
    </rw:objects>
    -->
    <html>
    <head>
    <meta name="GENERATOR" content="Oracle 9i Reports Developer"/>
    <title> Your Title </title>
    <rw:style id="yourStyle">
       <!-- Report Wizard inserts style link clause here -->
    </rw:style>
    </head>
    <body>
    <rw:dataArea id="yourDataArea">
       <!-- Report Wizard inserts the default jsp here -->
    </rw:dataArea>
    </body>
    </html>
    <!--
    </rw:report>
    -->
    ]]>
      </webSource>
      <reportPrivate versionFlags2="0" templateName="rwbeige"/>
      <reportWebSettings>
      <![CDATA[]]>
      </reportWebSettings>
    </report>Image data is encoded in hexadecimal format (base16) but the hex digits are reversed compared to the original byte sequence.
    For example, the first eight bytes in the source are :
    FFD8FFE0 00104A46but appears as FF8DFF0E 0001A464 in the XML file.
    You'll need a small program to read the file, extract the hex binary stream, process it and write back the data to a file.
    Example in PL/SQL (tested on db version 11.2.0.2) :
    DECLARE
    fid     utl_file.file_type;
    len     PLS_INTEGER := 1024;
    buf     RAW(512);
    module_name VARCHAR2(260) := 'MODULE1';
    dir_name    VARCHAR2(30) := 'TEST_DIR';
    BEGIN
      for r in (
        /* extract all image elements */
        select img_name
             , regexp_replace(img_data, '\s+') as img_data
        from xmltable('//body/image'
              passing xmltype(bfilename(dir_name, module_name||'.xml'), nls_charset_id('WE8MSWIN1252'))
              columns img_name varchar2(30) path '@name'
                    , img_data clob         path 'binaryData'
      loop
        /* output file */
        fid := utl_file.fopen(dir_name, module_name || '_' || r.img_name || '.jpg', 'wb', 32767);
        for i in 0..trunc((dbms_lob.getlength(r.img_data) - 1 )/len)
        loop
          /* read 1k of hex data and convert to binary */
          buf := hextoraw(
                   regexp_replace(
                     dbms_lob.substr(r.img_data, len, i*len + 1)
                   , '\2\1'
          utl_file.put_raw(fid, buf);
        end loop;
        utl_file.fclose(fid);
      end loop;
    END;
    /

  • XML stream utf-8 encoding

    Hi folks,
    I'm trying to establish a CSTRING XML stream with utf-8 encoding. I've only managed to do this in XSTRING so far.
    If i use this coding, i get a binary output.
      DATA: gt_result TYPE TABLE OF string,
             l_result type string.
      constants: encoding type string value 'UTF-8'.
      data:  g_ixml type ref to if_ixml.
      data:  g_stream_factory type ref to IF_IXML_STREAM_FACTORY.
      data:  g_encoding type ref to if_ixml_encoding.
      g_ixml = cl_ixml=>create( ).
      g_stream_factory = g_ixml->CREATE_STREAM_FACTORY( ).
      g_encoding = g_ixml->create_encoding( character_set = 'utf-8'
                                            byte_order = 0 ).
      data:  resstream type ref to if_ixml_ostream.
      resstream = g_stream_factory->create_ostream_cstring( l_result ).
      call method resstream->set_encoding
        EXPORTING
          encoding = g_encoding.
    * XML Transformieren
      CALL TRANSFORMATION id_indent
        SOURCE     itab = it_Itab
        RESULT XML resstream.
    * Temporär, XML File erzeugen
      refresh gt_result.
      APPEND l_result TO gt_result.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename         = 'c:test.xml'
        CHANGING
          data_tab         = gt_result
        EXCEPTIONS
          file_write_error = 1.
    Without this expression :
    g_encoding = g_ixml->create_encoding(
                 character_set = 'utf-8' byte_order = 0 ).
    I get a cstring stream, but in utf-16.
    My question now is, how do I manage to get a utf-8 encoded stream in cstring?
    Thanks for your help.
    Cheers
    Daniel

    This is the solution:
    METHOD TRANSFORM_XML.
      TYPE-POOLS TRUXS.
    *********************** XML ***********************************
      DATA: GT_RESULT TYPE TABLE OF STRING,
             L_RESULT TYPE ETXML_LINE_STR.
      CONSTANTS:  ENCODING     TYPE STRING VALUE 'UTF-8'.
      DATA:  G_IXML TYPE REF TO IF_IXML.
      DATA:  G_STREAM_FACTORY TYPE REF TO IF_IXML_STREAM_FACTORY.
      DATA:  G_ENCODING TYPE REF TO IF_IXML_ENCODING.
      G_IXML = CL_IXML=>CREATE( ).
      G_STREAM_FACTORY = G_IXML->CREATE_STREAM_FACTORY( ).
      G_ENCODING = G_IXML->CREATE_ENCODING( CHARACTER_SET = ENCODING
                                            BYTE_ORDER = 0 ).
      DATA:  RESSTREAM TYPE REF TO IF_IXML_OSTREAM.
      RESSTREAM = G_STREAM_FACTORY->CREATE_OSTREAM_XSTRING( L_RESULT ).
      CALL METHOD RESSTREAM->SET_ENCODING
        EXPORTING
          ENCODING = G_ENCODING.
    * XML Transformieren
      CALL TRANSFORMATION ID_INDENT
        SOURCE     ITAB = IT_ITAB
        RESULT XML RESSTREAM.
    * XString to String
      CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
        EXPORTING
          IM_XSTRING  = L_RESULT
          IM_ENCODING = 'UTF-8'
        IMPORTING
          EX_STRING   = E_XML.
    * Temporär, XML File erzeugen
      refresh gt_result.
      APPEND e_xml TO gt_result.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename         = 'c:test.xml'
        CHANGING
          data_tab         = gt_result
        EXCEPTIONS
          file_write_error = 1.
    ENDMETHOD.
    How can I give the 10 points to myself?
    Cheers
    Daniel

  • Parsing a UTF-8 encoded XML Blob object

    Hi,
    I am having a really strange problem, I am fetching a database BLOB object containing the XMLs and then parsing the XMLs. The XMLs are having some UTF-8 Encoded characters and when I am reading the XML from the BLOB, these characters lose their encoding, I had tried doing several things, but there is no means I am able to retain their UTF encoding. The characters causing real problem are mainly double qoutes, inverted commas, and apostrophe. I am attaching the piece of code below and you can see certain things I had ended up doing. What else can I try, I am using JAXP parser but I dont think that changing the parser may help because, here I am storing the XML file as I get from the database and on the very first stage it gets corrupted and I have to retain the UTF encoding. I tried to get the encoding info from the xml and it tells me cp1252 encoding, where did this come into picture and I couldn't try it retaining back to UTF -8
    Here in the temp.xml itself gets corrupted. I had spend some 3 days on this issue. Help needed!!!
    ResultSet rs = null;
        Statement stmt = null;
        Connection connection = null;
        InputStream inputStream = null;
        long cifElementId = -1;
        //Blob xmlData = null;
        BLOB xmlData=null;
        String xmlText = null;
        RubricBean rubricBean = null;
        ArrayList arrayBean = new ArrayList();
          rs = stmt.executeQuery(strQuery);
         // Iterate till result set has data
          while (rs.next()) {
            rubricBean = new RubricBean();
            cifElementId = rs.getLong("CIF_ELEMENT_ID");
                    // get xml data which is in Blob format
            xmlData = (oracle.sql.BLOB)rs.getBlob("XML");
            // Read Input stream from blob data
             inputStream =(InputStream)xmlData.getBinaryStream(); 
            // Reading the inputstream of data into an array of bytes.
            byte[] bytes = new byte[(int)xmlData.length()];
             inputStream.read(bytes);  
           // Get the String object from byte array
             xmlText = new String(bytes);
           // xmlText=new String(szTemp.getBytes("UTF-8"));
            //xmlText = convertToUTF(xmlText);
            File file = new File("C:\\temp.xml");
            file.createNewFile();
            // Write to temp file
            java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.FileWriter(file));
            out.write(xmlText);
            out.close();

    What the code you posted is doing:
    // Read Input stream from blob data
    inputStream =(InputStream)xmlData.getBinaryStream();Here you have a stream containing binary octets which encode some text in UTF-8.
    // Reading the inputstream of data into an
    into an array of bytes.
    byte[] bytes = new byte[(int)xmlData.length()];
    inputStream.read(bytes);Here you are reading between zero and xmlData.length() octets into a byte array. read(bytes[]) returns the number of bytes read, which may be less than the size of the array, and you don't check it.
    xmlText = new String(bytes);Here you are creating a string with the data in the byte array, using the platform's default character encoding.
    Since you mention cp1252, I'm guessing your platform is windows
    // xmlText=new new String(szTemp.getBytes("UTF-8"));I don't know what szTemp is, but xmlText = new String(bytes, "UTF-8"); would create a string from the UTF-8 encoded characters; but you don't need to create a string here anyway.
    //xmlText = convertToUTF(xmlText);
    File file = new File("C:\\temp.xml");
    file.createNewFile();
    // Write to temp file
    java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.FileWriter(file));This creates a Writer to write to the file using the platform's default character encoding, ie cp1252.
    out.write(xmlText);This writes the string to out using cp1252.
    So you have created a string treating UTF-8 as cp1252, then written that string to a file as cp1252, which is to be read as UTF-8. So it gets mis-decoded twice.
    As the data is already UTF-8 encoded, and you want the output, just write the binary data to the output file without trying to convert it to a string and then back again:// not tested, as I don't have your Oracle classes
    final InputStream inputStream = new BufferedInputStream((InputStream)xmlData.getBinaryStream());
    final int length = xmlData.length();
    final int BUFFER_SIZE = 1024;                  // these two can be
    final byte[] buffer = new byte[BUFFER_SIZE];   // allocated outside the method
    final OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
    for (int count = 0; count < length; ) {
       final int bytesRead = inputStream.read(buffer, 0, Math.min(BUFFER_SIZE, (length - count));
       out.write(buffer, 0, bytesRead);
       count += bytesRead;
    }Pete

  • Not able to handle Special Character in Bpel using UTF-8 Encoded XML

    I am using UTF-8 encoded xml for my application,but during conversion of XML from one source to other using simple BIOS java programme , i am not able to convert special characters like(Göblyös Tünde,Makaróni etc).All getting converted to (G�bly�s T�nde,Makar�ni etc).As a result data corruption occurred.Please let me know if any go across this issue.

    Hi,
    Possibly the data you receiving is not UTF-8... Have you check with the data provider?
    Try with other encoding... like ISO-8859-1 for example...
    oracle.soa.common.util.Base64Decoder.decode(zipname.getBytes("ISO-8859-1"));
    Cheers,
    Vlad

  • Set character encoding for data template xml output

    Hello everyone, in my data template, I have defined the header as
    <?xml version="1.0" encoding="WINDOWS-1256"?>
    but when output is generated, it is returned as:
    <?xml version="1.0" encoding="UTF-8"?>
    Is there a way for me to force the WINDOWS-1256 encoding in my data template?
    Many Thanks

    This data is read as
    bytes then I am using the InputStreamReader to convert
    to UTF-8 encoding.Don't you mean "from UTF-8 encoding"? Strings don't have an encoding, bytes can. And do you know that SQL Server produces those bytes encoded in UTF-8, or are you just assuming that?
    The stream is then written to a file with the
    extension ".xml". When I go and open the file, I get
    errors stating that the characters were not
    recognized.When you open the file with what? And what errors do you get?
    However, when I open the file with
    Notepad, I can see my xml data.

Maybe you are looking for

  • How do you forward a contact's details to someone else?

    My previous Nokia used to allow me to select a contact & then I cld forward it (the full contact details) to someone else's phone no. (with the press of 1 button). The iPhone 3G doesn't seem to have this basic feature that I can see (all you seem to

  • Button problem in IE

    I've built a quick splash page for a friend, with a button on the front to load a temporary second page. The button works great in Firefox and Safari, but doesn't work at all in IE (of course). I applied the active content update to both of the HTML

  • Kernel 2.6.13 archck

    i get a kernel panic when i use this kernel. it says something about the filesystem. i have tryed redoing the partitions but i still get a kernel panic with it. The 2.6.12 archck kernel worked great for me. i want my ati drivers back

  • Synching older Palm handheld with Outlook 2007 and Windows 7

    I have a Palm M515 running Palm OS 4.1. I just purchased a new computer, running Windows 7 and Office 2007. Although I transferred my old files, I needed to reinstall the Palm software from the disc. Otherwise, my synch cradle is connected as it was

  • Macbook and projectors

    I want to buy a new projector: there are many projectors out there and I'm interested in an HD projector. On this site (http://www.projectorcentral.com/home-theater-multimedia-projectors.htm) I found what I want but there is a question. What appens i