Query regarding Handling Unicode characters in XML

All,
My application reads a flat file in series of bytes, I
create a XMl document out of the data. The data contains Unicode characters.
I use a XSLT to create XML file. While creating it I don't face any issues
but later if I try to parse the constructed XMl file, i get a sax parsing exception
(Caused by: org.xml.sax.SAXParseException: Character reference _"<not visible clearly in Browser>"_ is an invalid XML character.)
Can some one advice on how to tackle this.
regards,
D
Edited by: user9165249 on 07-Jan-2011 08:10

How to tackle it? Don't allow your transformation to produce characters which are invalid in XML. The XML Recommendation specifies what characters are allowed and what characters aren't, in section 2.2: http://www.w3.org/TR/REC-xml/#charsets. The invalid characters can't come from the XML which you are transforming so they must be coming from code in your transformation.
And if you can't tell what the invalid characters are by using your browser, then send the result of the transformation to a file and use a hex editor to examine it.
By the way, this isn't a question about Unicode characters in XML, since all characters in Java are Unicode and XML is defined in terms of Unicode. So saying that your data contains Unicode characters is a tautology. It couldn't do anything else. If your personal definition of Unicode is "weird stuff that I don't understand" then do yourself a favour, take a couple of days out and learn what Unicode is.

Similar Messages

  • Oracle Receiver JDBC Adapter - Handling Unicode Characters

    We have an IDOC to JDBC scenario.
    In this IDOC is sending data like -  10/14u2019/P7 After 4 there is special character coming from SAP ( It is not single quote).
    Mapping is going through OK and data is getting saved in Oracle Database as 10/14&#x19;/P7 with & # x 19;
    I came across following solution in forums and SAP Note.
    I am not sure how to modify Oracle JDBC URL to handle Unicode characters properly.
    Or is there any other approach we can follow to achieve this..
    Any input is really appreciated
    Q: I am inserting Unicode data into a database table or selecting Unicode data from a table. However, the data inserted into or retrieved from the table appears garbled. Why doesn't the JDBC Adapter handle Unicode correctly?
    A: While the JDBC Adapter is Unicode-aware, many JDBC drivers and/or database management systems aren't by default and need a codepage or Unicode-awareness to be configured explicitly. For the respective JDBC drivers, this codepage setting is often configured via the driver URL. For details, refer to the documentation of your JDBC driver or database management system.

    Hi Simona,
    1.To start the visual admin, execute "go" file:
    On Windows: Run \usr\sap\<SAPSID>\JC<xx>\j2ee\admin\go.bat
    On UNIX: Run /usr/sap/<SAPSID>/JC<xx>/j2ee/admin/go
    2.supply the credentials to login into visual admin
    3.under "cluster" tab select "server node"
    4.you will find "log viewer" under "services"
    Since you are new, I recommend you to take help from your BASIS team.
    Hope it helps !
    Hi Alwin,
    Just a quick clarification.
    I used the URL you have mentioned, when we were on SP5. After that we upgraded to SP9.
    From SP9, if you try to use the URL http://XISERVER:50000/AdapterFramework then it automatically redirects to a new webpage with the link to the URL i have mentioned.
    Regards,
    Sridhar

  • Query regarding handling and monitoring of OSB Errors in a specific manner

    Hi,
    I'm using
    - OSB 10gR3 (10.3.1)
    Context
    To give some context, the setup I currently have a proprietory frontend client that is making XML/HTTP requests to OSB
    which in turn is getting info from downstream systems.
    I have no control over the behaviour/logic of the frontend client .. apart from knowing that it has a specific
    request/response format.
    So now to the issue..
    The issue I'm facing is regarding handling of errors. Based on my knowledge of OSB, the error handling of the transaction has been
    built along these lines
    (Within the stage) If an error scenario's occurred, error is being thrown
    (Within the error handler stage) Logging the error (using the 'Log' function .. with severity 'Error')
    (Within the error handler stage) The response payload is being built .. so that the error can be reported to the frontend client
    (Within the error handler stage) I'm doing a 'Reply with Success'
    Now this does give me the expected behavior from the frontend client's perspective (... i.e. it receives the payload and displays whatever error that's occurred)
    However from OSB's perspective, because I have done a 'Reply with success', the OSB Service Health Page ... (screenshot below) does not
    increment the 'Errors' count for the respective proxy service ....
    [OSB Service Health Page|http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/operations/monitoring.html#wp1107685] (Looking at Figure 3-8)
    The only way I could achieve this was to set the error handler stage to 'Reply with Failure' (which would return HTTP 500) ...
    The issue however is that, the proprietory frontend simply sees the incoming HTTP 500 code and doesn't read the return XML payload (containing the error details ..)
    which beats the whole idea of being able to maintain some sort of traceability for the failed transactions.
    So what I'm basically trying to find is .. that when an error occurs
    - Some 'call' to make the during the error handler stage so that it registers as an error in the OSB Service Health Page.. and I can clearly
    see the error count, etc for each of the proxy services
    - After that being able to still use 'Reply with Success' ... so that the payload is being returned with HTTP 500 code...
    so the frontend can read the payload ...
    ............. in essence, the idea being to register errors so that they can be monitored via the Service Health Dashboard ..but at the same time
    being able to return the 'error details' payload successfully
    With my limited (but growing) knowledge of OSB .. I've tried quite a few ways to achieve this with no success...
    Would very much appreciate any help here ...
    Lastly, if there is some way of achieving what I'm trying to get to above through different means, I'm open
    to trying out alternate stuff.
    Regards,
    Himanshu

    Hi Atheek,
    Many thanks for the reply. Does appear to be a pretty neat way of doing it ..
    One more clarification I'd like on this however ....
    Given that I have a set up like this below
    [External frontend client] <------> (1 Parent Service) <------> (2 Child Service)
    (1 Parent Service) .... has error handler .. and all it does is 'Reply with success'
    (2 Child Service) .... has error handler for particular stage
    so...
    2 Child Service - is doing the actual work (has error handler where custom error msg is being populated in $body)
    1 Parent Service - is the one that is getting called by the external client (has error handler .. and all it does is 'Reply with success')
    What I currently have is ..once the error occurs, I'm populating $body ... with the custom error message within the error handler
    Previously I had 'Reply with Success' in the 2 Child Service's error handler and the custom error message would get returned to the external client.
    Now, with the error handler only creating the custom error msg.... and 1 Parent service doing the 'Reply with Success' .. it doesn't appear
    to return the $body .. with the custom msg that I'd populated .. in 2 Child Service's error handler.
    Are the $body contents populated in 2 Child Service's error handler lost ...once the error propagates up to 1 Parent service's error handler ?
    If yes... is there way of getting around it ? I could see for instance that the $fault message context has a 'user populated' Details variable
    but the documentation covering this is sparse.
    Regards,

  • Handling special characters in XML

    Hi,
    I am using Oracle 10g 'XMLType' datatype to store XML files. Before storing I parse the XML document using Java Xerces Parser. If it parses successfuly, then I perform some business rule execution based on XML file which was parsed. So till this stage there is no problems. But when XML file contains some special characters like copy-paste of some description from MS-Word document into XML tags, then Xerces parser will parse such characters with out any exceptions, but while inserting XML document, Oracle database just throws exception saying unable to handle special characters.. So how to avoid such exceptions or silent such exceptions with any specific settings respect to XMLType datatype in 10g DB.
    Please advice!
    Arvind Patil - IN

    Monica--
    In XI 2.0, we've noticed a number of issues processing special characters, primarily caused by the version of JCO that we're running.  It sounds like SAP has spent some time in the past few months focusing on these errors, so make sure you're on the most recent patchlevels of all your middleware components, including any of the middleware libraries that BC uses. In XI, we had to update the 3 files that make up the RFC library and JCO library.  SDM couldn't update the libraries for us -- we had to manually move the files to the right place.
    Escaped XML characters like "&amp;" "&#34;" "&quot;" were fixed as of JCO 2.0.10 (the current patchlevel on AIX/UNIX), the special character "&apos;" is fixed in the next release, JCO 2.0.11, due out in a few weeks (hotfixes are available).  I don't know the equivalent versions on other platforms.  By default, XI 2.0 appears to have shipped with JCO 2.0.5.  I would expect many XI 3.0 users to also be affected.
    This may or may not apply to BC, because I don't know what BC uses to talk to SAP under the covers.
    --Dan King
    Capgemini

  • Query to Handle special characters in the conditions

    Hi all,
    We have a table for colour codes and there related information but the colour codes have special characters in them like
    AL&.MPD
    CH(SB00
    ECA&BC1
    TD..0023
    0O'DON4
    i need to check if these exist in the table or not but when i query like
    select * from art.tb_color_code where color_code in ('AL&.MPD','CH(SB00','ECA&BC1','TD..0023','0O'DON4');
    i get prompts for entering the variable values there are 2500 such codes
    how do i negate the special meanings of these characters
    Regards
    Maverick

    Hi,
    If a string literal contains an apostrophe, use two consecutive apostrophes.
    For example:
    '0O''DON4'is a seven-character string. The third character is an apostrophe.
    As others have said,
    SET   DEFINE  OFFwill disable the special meaning of & in SQL*Plus.

  • Handle special characters in xml

    Hi,
      Our end users tend to copy the description text from Word documents to pdf form and submits it.
    If that text contains any special characters, its getting carried to the extracted xml. In the next step, when I try to assign a task to user with template and this xml, Managers cannot able to open the form and showing the error. When I assign the xml without special characters, its running fine.
    Please assist on how to handle this?
    My expectation is that user should be prompted in the form when he pastes any special characters or they should be auto-corrected to null values. if that is not possible, atleast we should able to filter the xml and eliminate special characters before the form go to next stage.
    Appreciate your help.
    Thanks,
    Krishna

    In first instance, I would have followed this way:
    http://www.dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.h tml
    so, I would have parsed the submitted text in a Validate event and changed any special chars to UTF-8 numeric reference.
    However, I found this:
    http://blog.mark-mclaren.info/2007/02/invalid-xml-characters-when-valid-utf8_5873.html
    which seems to state that not all UTF-8 characters are possible in XML.
    In fact, those allowed are listed here:
    http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
    so, I would still use a Validate event script but based on the XML specs' Character Range. Exactly as Mark McLaren did in Java.
    This will permit to keep those special chars that are allowed. Your Managers will thank you.
    Hope it helps.

  • Unicode characters a real challenge??????

    Hello everybody
    I cannot believe it that no one has been able to help me with displaying unicode characters (Arabic letters in particular) I have posted 2 threads no one has answered. I hope that someone out there knows how to handle unicode characters.
    that includes reading and writing them to a file.
    Hope you can help.
    Rana

    Hello Rana,
    Please use this code as a sample. You have to use this code inside of your paint() method.
    String myString = "\u0635\u0634\u0633\u0632\u0631\u0630\u0629\u0628\u0627";
    g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM));
    g.drawString(myString, (this.getWidth() - (Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM).stringWidth(myString))), 0, Graphics.TOP|Graphics.LEFT);And you can find the full list of unicode table of Arabic letters at this document:
    http://www.unicode.org/charts/PDF/U0600.pdf
    If you have some troubleshooting, please come back again, we can find a solution.
    Regards,
    Ran

  • How the SDK handles unicode

    I spent several painful hours learning the following about how the SDK handles unicode characters -- perhaps I've missed where this is documented?  Here's what I learned:
    - Lua strings are sequences of 8-bit characters (bytes).
    - A unicode ZString is represented as a Lua string containing the UTF-8 encoding of the unicode ZString.  For example, the trademark character (TM) is unicode codepoint 2122 (hex), and the ZString LOC "$$$/unicode/tm=^U+2122" is represented as a Lua string of length three, the UTF-8 encoding of that character (decimal bytes 226 132 162).
    - A posting from Adobe employee "escouten" last year said that all SDK APIs treat all Lua strings as UTF-8 encoding of unicode strings.  I've personally observed that with LrView, LrFileUtils, and LrTasks.execute, but haven't checked other APIs.  In particular, a Windows unicode filename will be returned by LrFilteUtils as a Lua string encoding the the filename in UTF-8.  Passing that filename in a command line to LrTasks.execute works correctly.  (But writing a Windows batch file with a UTF-8 filename won't in general work -- a topic for another day.)

    Hi John,
    I'm struggling a little with this UTF-8 topic currently. I can sympathize with your several painful hours now. :-)
    1) Can you (or somebody else) reproduce the following issue: (Win 8.1. LR 5.6)
    If your photos are stored in a UTF-8 encoded directory such as c:\users\username\Pictøäöüש (the last letter being the Hebrew letter shin). (This is kind of my test case after users from Norway and Israel reported problems.)
        local picName = selectedPhoto:getRawMetadata ("path")
        outputToLog (picName)
    I get the wrong result:
    C:\Users\username\Pictøäöüש\7L6B7931.CR2
    If I use, on the other hand, getFormattedMetadata:
    outputToLog (selectedPhoto:getFormattedMetadata ("folderName") .. " and " .. selectedPhoto:getFormattedMetadata ("fileName"))
    I get a correct result (but not the full pathname)
    Pictøäöüש and 7L6B7931.CR2
    Going from there, I could probably figure out the full path name (which does not seem to be offered in getFormattedMetadata), but I would like to figure out what's wrong with selectedPhoto:getRawMetadata ("path").
    2) The following is more for reference: I cannot seem to pass previews.db path name to sqlite if the path of the previews.db (LR catalog path) contains non-ASCII utf-8 characters.  (Other UTF8 commands on the command line work well.) chcp 65001 doesn't help. sqlite is supposed to accept UTF8 characters in the db name, but somehow doesn't (at least my version, which is somewhat older). I have worked around this issue by first cd-ing to the directory and then starting sqlite i.e. along the lines of "cd <previews-dir> && sqlite3 previews.db" This seems to work so far, even if some new issues have come up of which I don't know yet whether they are related to this or not.

  • Direct Execution of query having Unicode Characters

    Direct Execution of query having Unicode Characters
    Hi All,
    In my application I am firing a Select Query having Unicode characters in Where Clause under condition like '%%'
    to Oracle 10g DB from a Interface written in VC6.0...
    Application funcationality is working fine for ANSI characters and getting the result of Select properly.
    But in case of Unicode Characters in VC it says 'No Data Found'.
    I know where the exact problem is in my code. But not getting the exact solution for resolving my issue...
    Here with I am adding my code snippet with the comments of what i understand and what i want to understand...
    DBPROCESS Structure used in the functions,_
    typedef struct
    HENV hEnv;
    HDBC hDbc;
    HSTMT hStmt;
    char CmdBuff[[8192]];
    char RpcParamName[[255]];
    SQLINTEGER SpRetVal;
    SQLINTEGER ColIndPtr[[255]];
    SQLINTEGER ParamIndPtr[[255]];
    SQLPOINTER pOutputParam;
    SQLUSMALLINT CurrentParamNo;
    SQLUSMALLINT OutputParamNo;
    SQLUSMALLINT InputParamCtr;
    SQLINTEGER BatchStmtNo;
    SQLINTEGER CmdBuffLen;
    short CurrentStmtType;
    SQLRETURN LastStmtRetcode;
    SQLCHAR SqlState[[10]];
    int ShowDebug;
    SQLCHAR* ParameterValuePtr;
    int ColumnSize;
    DBTYPE DatabaseType;
    DRVTYPE OdbcDriverType;
    BLOCKBIND *ptrBlockBind;
    } DBPROCESS;
    BOOL CDynamicPickList::GetResultSet(DBPROCESS *pDBProc, bstrt& pQuery, short pNumOdbcBindParams, COdbcBindParameter pOdbcBindParams[], CQueryResultSet& pQueryResultSet)
         int               lRetVal,
                        lNumRows;
         bstrt               lResultSet;
         wchar_t               lColName[[256]];     
         SQLUINTEGER          lColSize;
         SQLSMALLINT          lColNameLen,
                        lColDataType,
                        lColNullable,
                        lColDecDigits,                         
                        lNumResultCols;
         wchar_t               lResultRow[[32]][[256]];
    OdbcCmdW(pDBProc, (wchar_t *)pQuery); *//Query is perfectly fine till this point all the Unicode Characters are preserved...*
         if ( OdbcSqlExec(pDBProc) != SUCCEED )
              LogAppError(L"Error In Executing Query %s", (wchar_t *)pQuery);          
              return FALSE;
    Function OdbcCmdW_
    //From this point have no idea what is exactly happening to the Unicode Characters...
    //Actually i have try printing the query that gets stored in CmdBuff... it show junk for Unicode Characters...
    //CmdBuff is the Char type Variable and hence must be showing junk for Unicode data
    //I have also try printing the HexaDecimal of the query... I m not getting the proper output... But till i Understand, I think the HexaDecimal Value is perfect & preserved
    //After the execution of this function the call goes to OdbcSqlExec where actual execution of qurey takes place on DB
    SQLRETURN OdbcCmdW( DBPROCESS p_ptr_dbproc, WCHAR      p_sql_command )
         char *p_sql_commandMBCS;
         int l_ret_val;
         int l_size = wcslen(p_sql_command);
         int l_org_length,
    l_newcmd_length;
    p_sql_commandMBCS = (char *)calloc(sizeof(char) * MAX_CMD_BUFF,1);
    l_ret_val = WideCharToMultiByte(
                        CP_UTF8,
                        NULL,                         // performance and mapping flags
                        p_sql_command,          // wide-character string
                        -1,                         // number of chars in string
                        (LPSTR)p_sql_commandMBCS,// buffer for new string
                        MAX_CMD_BUFF,                    // size of buffer
                        NULL, // default for unmappable chars
                        NULL // set when default char used
    l_org_length = p_ptr_dbproc->CmdBuffLen;
    l_newcmd_length = strlen(p_sql_commandMBCS);
    p_ptr_dbproc->CmdBuff[[l_org_length]] = '\0';
    if( l_org_length )
    l_org_length++;
    if( (l_org_length + l_newcmd_length) >= MAX_CMD_BUFF )
    if( l_org_length == 0 )
    OdbcReuseStmtHandle( p_ptr_dbproc );
    else
    strcat(p_ptr_dbproc->CmdBuff, " ");
         l_org_length +=2;
    strcat(p_ptr_dbproc->CmdBuff, p_sql_commandMBCS);
    p_ptr_dbproc->CmdBuffLen = l_org_length + l_newcmd_length;
    if (p_sql_commandMBCS != NULL)
         free(p_sql_commandMBCS);
    return( SUCCEED );
    Function OdbcSqlExec_
    //SQLExecDirect Requires data of Unsigned Char type. Thus the above process is valid...
    //But i am not getting what is the exact problem...
    SQLRETURN OdbcSqlExec( DBPROCESS *p_ptr_dbproc )
    SQLRETURN l_ret_val;
    SQLINTEGER l_db_error_code=0;
         int     i,l_occur = 1;
         char     *token_list[[50]][[2]] =
    {     /*"to_date(","convert(datetime,",
                                       "'yyyy-mm-dd hh24:mi:ss'","1",*/
                                       "nvl","isnull" ,
                                       "to_number(","convert(int,",
                                       /*"to_char(","convert(char,",*/
                                       /*"'yyyymmdd'","112",
                                       "'hh24miss'","108",*/
                                       "sysdate",     "getdate()",
                                       "format_date", "dbo.format_date",
                                       "format_amount", "dbo.format_amount",
                                       "to_char","dbo.to_char",
                                       "to_date", "dbo.to_date",
                                       "unique","distinct",
                                       "\0","\0"};
    char          *l_qry_lwr;  
    l_qry_lwr = (char *)calloc(sizeof(char) * (MAX_CMD_BUFF), 1);
    l_ret_val = SQLExecDirect( p_ptr_dbproc->hStmt,
    (SQLCHAR *)p_ptr_dbproc->CmdBuff,
    SQL_NTS );
    switch( l_ret_val )
    case SQL_SUCCESS :
    case SQL_NO_DATA :
    ClearCmdBuff( p_ptr_dbproc );
    p_ptr_dbproc->LastStmtRetcode = l_ret_val;
    if (l_qry_lwr != NULL)
         free(l_qry_lwr);
    return( SUCCEED );
    case SQL_NEED_DATA :
    case SQL_ERROR :
    case SQL_SUCCESS_WITH_INFO :
    case SQL_STILL_EXECUTING :
    case SQL_INVALID_HANDLE :
    I do not see much issue in the code... The process flow is quite valid...
    But now i am not getting whether,
    1) storing the string in CmdBuff is creating issue
    2) SQLExecDirect si creating an issue(and some other function can be used here)...
    3) Odbc Driver creating an issue and want some Client Setting to be done(though i have tried doing some permutation combination)...
    Any kind of help would be appreciated,
    Thanks & Regards,
    Pratik
    Edited by: prats on Feb 27, 2009 12:57 PM

    Hey Sergiusz,
    You were bang on target...
    Though it took some time for me to resolve the issue...
    to use SQLExecDirectW I need my query in SQLWCHAR *, which is stored in char * in my case...
    So i converted the incoming query using MultibyteToWideChar Conversion with CodePage as CP_UTF8 and
    then passed it on to SQLExecDirectW...
    It solved my problem
    Thanks,
    Pratik...
    Edited by: prats on Mar 3, 2009 2:41 PM

  • Retrieving Unicode characters with MS Query

    Hi.
    I am using MS Query to retrieve data into Excel from an Oracle database.  The data contains several different characters (such as degree and diameter symbols) which are stored as Unicode, but the query returns the same character for all of them.
    In the MS Query window the special characters appear as upside down question marks; in Excel they show as white question marks in a black diamond.  The ASCII code of the character displayed in Excel is '63', and the UNICODE() value is 65533.  This
    isn't the character that is stored in the Oracle database.
    Is there a way to correctly retrieve these characters? 
    The ODBC driver is Oracle in OraClient11g_home1, version 11.02.00.01.  I've tried it with the 'Force SQL_WCHAR Support' setting on, but it didn't make a difference.  So, I've pretty much exhausted my knowledge now...
    Thanks in advance,  Steve

    Hi
    Steve,
    As far as I know the function of MS Query didn’t update anymore after the version of excel 2003. I suppose the issue might be caused by the different rules between Unicode
    and ASCII code, so you get different result in excel from Oracle database. I suggest you can try to use PowerQuery and PowerPivot. Their function are stronger than MS Query, and you can get latest function. Probably they can help you to solve your issue.
    Hope it’s helpful.
    Regards,

  • Special Unicode characters in RSS XML

    Hi,
    I'm using an adapted version of Husnu Sensoy's solution (http://husnusensoy.wordpress.com/2007/11/17/o-rss-11010-on-sourceforgenet/ - thanks, Husnu) to consume RSS feeds in an Apex app.
    It works a treat, except in cases where the source feeds contain special unicode characters such as [right double quotation mark  - 0x92  0x2019] (thankyou, http://www.nytimes.com/services/xml/rss/nyt/GlobalBusiness.xml)
    These cases fail with
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8217 (U+2019) Error at line 19
    Any ideas on how to translate these characters, or replace them with something innocuous (UNISTR?), so that the XML transformation succeeds?
    Many thanks,
    jd
    The relevant code snippet is:
    procedure get_rss
    (  p_address                 in httpuritype
    ,  p_rss                    out t_rss
    is
       function oracle_transformation
          return       xmltype is
          l_result     xmltype;
       begin
          select xslt
          into   l_result
          from   rsstransform
          where  rsstransform = 0;
          return l_result;
       exception
       when no_data_found then
          raise_application_error(-20000, 'Transformation XML not found');
       when others then
          l_sqlerrm := sqlerrm;
          insert into errorlog...
       end oracle_transformation;
    begin
       xmltype.transform(p_address.getXML()
                        ,oracle_transformation
                        ).toobject(p_rss);
    exception
    when others then
      l_sqlerrm := sqlerrm;
      insert into errorlog....
    end get_rss;My environment:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_CHARACTERSET WE8ISO8859P1
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE

    environment
    Oracle 10g R2 x86 10.2.0.4 on RHEL4U8 x86.
    db NLS_CHARACTERSET WE8ISO8859P1
    After following the following note:
    Changing US7ASCII or WE8ISO8859P1 to WE8MSWIN1252 [ID 555823.1]
    the nls_charset was changed:
    Database character set WE8ISO8859P1
    FROMCHAR WE8ISO8859P1
    TOCHAR WE8MSWIN1252
    And the error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8217 (U+2019)
    was no longer generated.
    A Unicode database charset was not required in this case.
    hth.
    Paul

  • Oracle 6i Report Output Japanese Characters to XML on UNIX?

    I have a 6i report which reads text from the database and outputs everything to XML. There is now a requirement for it to handle Japanese characters.
    I was able to do this successfully in Windows by changing my NLS_LANG to UTF8 and changing the field font to a Unicode font. I then ran the report, and the XML that was output contains the correct Japanese characters from the underlying database query.
    When I port the report to UNIX, the report runs, but the Japanese characters all show up as upside-down question marks in the XML. If I open the report in Reports Builder from the server, I do not see any Unicode fonts, but it changed my selected font to "clear".
    Can anyone suggest the fix to get this working in UNIX? Does a new font need to be installed on the server to support this?
    Thanks in advance for any suggestions!

    we used UTF8 which worked fine with that.

  • How to remove special characters in xml

    Dear friends,
    How to remove the special character  from the xml. I am placing the xml file and  fetching through file adapter.
    The problem is when there is any special character in xml. i am not able to pass to target system smoothly.
    Customer asking schedule the file adapter in order to do that the source xml should not have any special charatcters
    How to acheive this friends,
    Thanx in advance.
    Take care

    Hi Karthik,
    Go throgh the following links how to handle special character
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Restricting special characters in XML within XI..
    Regards
    Goli Sridhar

  • How do I get unicode characters out of an oracle.xdb.XMLType in Java?

    The subject says it all. Something that should be simple and error free. Here's the code...
    String xml = new String("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<x>\u2026</x>\n");
    XMLType xmlType = new XMLType(conn, xml);
    conn is an oci8 connection.
    How do I get the original string back out of xmlType? I've tried xmlType.getClobVal() and xmlType.getString() but these change my \u2026 to 191 (question mark). I've tried xmlType.getBlobVal(CharacterSet.UNICODE_2_CHARSET).getBytes() (and substituted CharacterSet.UNICODE_2_CHARSET with a number of different CharacterSet values), but while the unicode characters are encoded correctly the blob returned has two bytes cut off the end for every unicode character contained in the original string.
    I just need one method that actually works.
    I'm using Oracle release 11.1.0.7.0. I'd mention NLS_LANG and file.encoding, but I'm setting the PrintStream I'm using for output explicitly to UTF-8 so these shouldn't, I think, have any bearing on the question.
    Thanks for your time.
    Stryder, aka Ralph

    I created analogic test case, and executed it with DB 11.1.0.7 (Linux x86), which seems to work fine.
    Please refer to the execution procedure below:
    * I used AL32UTF8 database.
    1. Create simple test case by executing the following SQL script from SQL*Plus:
    connect / as sysdba
    create user testxml identified by testxml;
    grant connect, resource to testxml;
    connect testxml/testxml
    create table testtab (xml xmltype) ;
    insert into testtab values (xmltype('<?xml version="1.0" encoding="UTF-8"?>'||chr(10)||'<x>'||unistr('\2026')||'</x>'||chr(10)));
    -- chr(10) is a linefeed code.
    commit;
    2. Create QueryXMLType.java as follows:
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.XMLType;
    import java.util.*;
    public class QueryXMLType
         public static void main(String[] args) throws Exception, SQLException
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              OracleConnection conn = (OracleConnection) DriverManager.getConnection("jdbc:oracle:oci8:@localhost:1521:orcl", "testxml", "testxml");
              OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement("select xml from testtab");
              ResultSet rs = stmt.executeQuery();
              OracleResultSet orset = (OracleResultSet) rs;
              while (rs.next())
                   XMLType xml = XMLType.createXML(orset.getOPAQUE(1));
                   System.out.println(xml.getStringVal());
              rs.close();
              stmt.close();
    3. Compile QueryXMLType.java and execute QueryXMLType.class as follows:
    export PATH=$ORACLE_HOME/jdk/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export CLASSPATH=.:$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/jlib/orai18n.jar:$ORACLE_HOME/rdbms/jlib/xdb.jar:$ORACLE_HOME/lib/xmlparserv2.jar
    javac QueryXMLType.java
    java QueryXMLType
    -> Then you will see U+2026 character (horizontal ellipsis) is properly output.
    My Java code came from "Oracle XML DB Developer's Guide 11g Release 1 (11.1) Part Number B28369-04" with some modification of:
    - Example 14-1 XMLType Java: Using JDBC to Query an XMLType Table
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb11jav.htm#i1033914
    and
    - Example 18-23 Using XQuery with JDBC
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_xquery.htm#CBAEEJDE

  • How to use Unicode characters with TestStand?

    I'm trying to implement the use of Greek characters such as mu and omega for units. I enabled multi-byte support in the station options and attempted to paste some characters in. I was able to paste the mu character (μ) and import it from Excel with PropertyLoader. However, I have not had any luck with omega (Ω). I found the HTML codes for these characters on a web page (http://www.hclrss.demon.co.uk/unicode/) so I could use those codes for HTML reports, but that won't work for database logging, nor does it display the characters correctly for the operator interface. The operator interface is not a major problem, but the database must have the correct characters for customer reports. Anyone know how to do this? D
    oes database logging support Unicode for stored procedure calls to Oracle?

    Hello Mark -
    At this time TestStand has no unicode support. The multi-byte support that we do offer is based on the Windows architecture that handles Asian language fonts. It really isn't meant to provide a bridge for unicode values in TestStand. Certainly, your Operator Interface environment will have its own support level for unicode, i.e. at this time neither LabWindows/CVI version 6.0 nor LabVIEW 6.1 officially support unicode characters. This is why you will see that the units defined in the TestStand enumerators are all text-based values.
    I have run a quick test here, probably similar to what you were doing on your end, and I am uncertain if you will get the database behavior you want from TestStand. The database logging steps and API all use basic char sty
    le strings to communicate to the driver. Even though you are reading in a good value from Excel, TestStand is interpreting the character as the nearest ASCII equivalent, i.e. "Ω" will be stored and sent to the database as "O". If you have a stored proceedure in Oracle that is calling on some TestStand variable or property string as an input, then it is doubtful you will get correct transmission of the values to the database. If your stored proceedure could call into a spreadsheet directly, you would probably have better luck.
    Regards,
    Elaine R.
    National Instruments
    http://www.ni.com/ask

Maybe you are looking for