Handling multibyte characters

Hello

I created a procedure that sends an e-mail with UTL_SMTP.

The procedure includes a section in which we add attachments to e-mail.

Now, the question is when I add an attachment that contains multibyte characters, these characters are replaced by '?'.

Can anyone provide guidance on this?

It works fine now.

First of all, I discovered that if the SMTP server supports the 8BITMIME extension, in my case it was the case

Then while keeping the same thing, I've converted prior to the given RAW and then used WRITE_RAW_DATA.

Tags: Database

Similar Questions

  • IMPDP SQLFILE: constraint_name multibyte characters leads to ORA-00972

    Hello

    I'm actually constraint_name made of multibyte characters (for example: constrain_name = "VALIDA_CONFIRMAÇÃO_PREÇO13").
    Of course this Bad Idea® is hereditary (I'm against all the stuff of fantasy as water in the names of files or directories on my filesystem...)

    The scenario is as follows:
    0 - I'm supposed to do a 'remap_schema '. Everything in the schema SCOTT should now be in a schema NEW_SCOTT.
    1 - the scott schema is exported via datapump
    2 - I'm an impdp with SQLFILE to remove all the DDL (table, packages, synonyms, etc...)
    3. I do a few sed on the sqlfile generated to replace each occurrence of SCOTT at NEW_SCOTT (this part is OK)
    4. once the modified sqlfile is executed, I'm doing an impdp with DATA_ONLY.

    (The scenario was envisioned in this thread: {message identifier: = 10628419})

    I get a few ORA-00972: identifier is too long to step 4, when you run the sqlfile.
    I see that some DDL for creating the constraint in the file (generated in step # 2) is read as follows:
    ALTER TABLE "TW_PRI"."B_TRANSC" ADD CONSTRAINT "VALIDA_CONFIRMAÃÃO_PREÃO14" CHECK ...
    Of course, the original name of the constraint with the cedilla and the tilde translates to something that is longer than 30 char/byte...

    As the original name is the Brazil, I also tried to add an EXPORT LANG = pt_BR. UTF-8 in my script before you run the impdp for sqlfile. It doesn't change anything. (the original $LANG is en_US. UTF-8)

    To create a unit test for this thread, I tried to reproduce it on my sandbox database... but, I don't have the issue. :-(

    The real system is a database of 4-nodes on Exadata (11.2.0.3) with NLS_CHARACTERSET = AL32UTF8.
    My sandbox database is a 11.2.0.1 (nonRAC) on RHEL4 AL32UTF8 also.

    The constraint_name argument is the same on the two system: I checked byte by byte using DUMP() on the constraint_name argument.

    Feel free to make light and/or seek clarification if necessary.


    Thanks in advance for those who will take their time to read all this.
    :-)

    --------
    I decided to register my testcase to my sandbox database, even if it does NOT reproduce the issue + (maybe I'm missing something obvious...) +.

    I use the following files.
    -createTable.sql:
    $ cat createTable.sql 
    drop table test purge;
    
    create table test
    (id integer,
    val varchar2(30));
    
    alter table test add constraint VALIDA_CONFIRMAÇÃO_PREÇO13 check (id<=10000000000);
    
    select constraint_name, lengthb(constraint_name) lb, lengthc(constraint_name) lc, dump(constraint_name) dmp
    from user_constraints where table_name='TEST';
    -expdpTest.sh:
    $ cat expdpTest.sh 
    expdp scott/tiger directory=scottdir dumpfile=testNonAscii.dmp tables=test
    -impdpTest.sh:
    $ cat impdpTest.sh 
    impdp scott/tiger directory=scottdir dumpfile=testNonAscii.dmp sqlfile=scottdir:test.sqlfile.sql tables=test
    It comes to the race:
    [oracle@Nicosa-oel test_nonAsciiColName]$ sqlplus scott/tiger
    
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 12 18:58:27 2013
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> @createTable
    
    Table dropped.
    
    
    Table created.
    
    
    Table altered.
    
    
    CONSTRAINT_NAME                  LB       LC
    ------------------------------ ---------- ----------
    DMP
    --------------------------------------------------------------------------------
    VALIDA_CONFIRMAÇÃO_PREÇO13             29         26
    Typ=1 Len=29: 86,65,76,73,68,65,95,67,79,78,70,73,82,77,65,195,135,195,131,79,95
    ,80,82,69,195,135,79,49,51
    
    
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@Nicosa-oel test_nonAsciiColName]$ ./expdpTest.sh 
    
    Export: Release 11.2.0.1.0 - Production on Tue Feb 12 19:00:12 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** directory=scottdir dumpfile=testNonAscii.dmp tables=test 
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    . . exported "SCOTT"."TEST"                                  0 KB       0 rows
    Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
    ******************************************************************************
    Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
      /home/oracle/scott_dir/testNonAscii.dmp
    Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 19:00:22
    
    [oracle@Nicosa-oel test_nonAsciiColName]$ ./impdpTest.sh 
    
    Import: Release 11.2.0.1.0 - Production on Tue Feb 12 19:00:26 2013
    
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_TABLE_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_TABLE_01":  scott/******** directory=scottdir dumpfile=testNonAscii.dmp sqlfile=scottdir:test.sqlfile.sql tables=test 
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Job "SCOTT"."SYS_SQL_FILE_TABLE_01" successfully completed at 19:00:32
    
    [oracle@Nicosa-oel test_nonAsciiColName]$ cat scott_dir/test.sqlfile.sql 
    -- CONNECT SCOTT
    ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
    -- new object type path: TABLE_EXPORT/TABLE/TABLE
    CREATE TABLE "SCOTT"."TEST" 
       (     "ID" NUMBER(*,0), 
         "VAL" VARCHAR2(30 BYTE)
       ) SEGMENT CREATION DEFERRED 
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 COMPRESS FOR OLTP LOGGING
      TABLESPACE "MYTBSCOMP" ;
     
    -- new object type path: TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    ALTER TABLE "SCOTT"."TEST" ADD CONSTRAINT "VALIDA_CONFIRMAÇÃO_PREÇO13" CHECK (id<=10000000000) ENABLE;
    I was expecting the cedilla and the tilde characters not displayed correctly...

    Published by: Nicosa on February 12, 2013 19:13

    Hello
    I had some strange effects if I didn't set the translation be utf8 in my ssh client (PuTTY in my case). Is - this somehow something that automatically happens in an environment, but not the other?

    In putty, this is the window-> translation and then choose utf8

    Also make sure that's not sed plague rather than impdp?

    See you soon,.
    Harry

  • ExtendScript handling special characters

    Hello

    I'm working on my first script for After Effects. I've never worked with JavaScript so please bare with me if the answer to my question is very simple.

    I am simply read a .txt file and parses strings in variables. I then take these variables and using the strings to populate the text layers in After Effects. Everything works perfectly and more that he will not perform "special characters" in the Spanish language. How JavaScript to allow these characters to be filled in text layers?

    Here is my code:

    MAIN FUNCTION

    var newFile = File.openDialog ("file read.");

    If (newFile! = null) {}

    var a = readDocument(newFile,_1).contentAry;

    replaceText (a);

    }

    Checks if the document exists-> If Yes, creates new table and populates file

    function readDocument (inputDoc, linesToSkip) {}

    var curDoc = new queue (inputDoc);

    {if (curDoc.Exists)}

    var contentAry = new Array();

    curDoc.open ("r");

    fills up to the end of the txt file

    {while(!curDoc.EOF)}

    contentAry [contentAry.length] = curDoc.readln ();

    }

    curDoc.close ();

    }

    Replaces the normal table space characters

    contentAry.splice (0, linesToSkip);

    var contentList = contentAry.join("_gap_").toString () replace (new RegExp ("_gap_", "g"), '\r');

    contentAry = contentAry;

    return {}

    'contentAry': contentAry,

    "contentList": contentList

    }

    }

    Function to replace text in layer

    function replaceText (content) {}

    try {}

    variables for specific layers that are targeted

    var layerOneA = app.project.item (3) .layer (1);

    var layerTwoA = app.project.item (3) .layer (2);

    var layerThreeA = app.project.item (3) .layer (3);

    var layerOneB = app.project.item (4) .layer (1);

    var layerTwoB = app.project.item (4) .layer (2);

    check that the parameter passed through to the function is an array

    If {(contents instanceof Array)

    var curLine, lineOne, lineTwo, lineThree, lineFour, pl;

    var aryLength = content.length;

    runs the table & analysis of its data to variables

    for (var i = 0; i < aryLength; i ++) {}

    curLine = happy [i];

    PL = parse (curLine);

    lineOne = pl.title;

    lineTwo = pl.msg;

    lineThree = pl.tune;

    lineFour = pl.name;

    Another used for loop so the function works on the main compositions (all nested these comps)

    for (var x = 0; x < 2; x ++) {}

    if(x == 0) {}

    layerOneA.sourceText.setValue (lineOne);

    layerTwoA.sourceText.setValue (lineTwo);

    layerThreeA.sourceText.setValue (lineThree);

    } else {}

    layerOneB.sourceText.setValue (lineOne);

    layerTwoB.sourceText.setValue (lineThree);

    }

    }

    docName.name.setValue (lineFour);

    Alert (docname. (Name)

    }

    }

    '\r',} catch (err) {alert (err.line.toString () + err.toString ())};

    }

    Split strings in the table into separate objects

    function parse (myText) {}

    {while (!) MyText.EOF)}

    var t = myText.split ("\t");

    return {}

    'title': t [0],

    'msg': t [2],

    'tune': t [3].

    'name': t [4]

    }

    }

    }

    Thank you very much for your help!

    The file object has a 'encoding' property, see the Guide to the JavaScript section on "Unicode i/o tools.
    Make sure you read the txt file in the encoding it is written. Better to use an encoding like utf8 that supports way more special than ascii symbols, for example.

  • How to handle special characters in the Apex

    Hello

    In my application, I have two regions - region report (interactive report) and other is region HTML with text elements two - Empno and name

    My report has two columns Empno (varchar2) and Ename (varchar2).

    When I click on the link change in the column of the report, the empno should be a read-only value EMPNO and ename is a text with the value of the ENAME field.

    When I run my application, I have encountered the following problems:
    1. If my empno has special characters such as "#", the characters after that is not posting
    2. If my empno has special characters such as "," characters after the decimal point is considered to be a value of next texitem

    Here is my authentication information,

    CTSAN_ORACLE_DB workspace
    Username [email protected]
    Password lakshmi321
    URL: http://apex.oracle.com/pls/apex/f?p=9444:19:4292839314890159:


    Please, I beg you. suggest me how to fix these problems.

    Thank you
    David...

    Published by: David on August 13, 2010 03:05

    Do not pass the data values in the URL. If it is possible to escape values to make URL - and APEX parameter-safe, it is much better to avoid the problem completely.

    Create a primary key of the substitution on the table which is an immutable discreet digital identifier and use it only as a URL parameter. In pages/target areas, use this value of PK to extract the data from the table.

  • xmlserialize with special characters

    Hello

    I am looking for a way to preserve special characters when using xmlserialize:

    When I run this query:

    Select xmlserialize (content xmltype('<Owner>Grand''co</Owner>').extract('/*') dash)

    Double;

    I get this result:

    < owner > big& apos; Co < / owner >

    I like to keep the "'" instead of having the "& apos;

    Does anyone have a solution?

    Thank you

    Martin

    Post edited by: Martin L.

    I don't have a problem but the xml code is downloaded from a Government website, and I don't know if they have properly managed these reserved characters. I don't know if they will save in their database of escape characters "" or they it will convert the reserved character.

    I don't think you need to worry about this.

    An XML parser must properly handle these characters and the corresponding predefined entity references.

  • Multibyte character sets

    Hi all

    Sql engine is 4 000 bytes for varchar2 columns supported by Oracle. No matter, we store 4000 (single byte) characters or characters multibyte n (where n < 4000). I'm skeptical for cases where the database supports multibyte characters. Can we have 4000 stored in a column varchar2 oracle multibyte characters? In any case (characterset)?

    Thank you

    OracleManiac wrote:

    Hi all

    Sql engine is 4 000 bytes for varchar2 columns supported by Oracle. No matter store us 4000 (single byte) characters or characters multibyte n (where n)<4000) .i="" am="" skeptical="" for="" those="" cases="" where="" the="" database="" supports="" multibyte="" characters="" .="" can="" we="" have="" 4000="" multibyte="" characters="" stored="" in="" a="" varchar2="" column="" in="" oracle="" in="" any="" case="">

    Thank you

    No - bytes equals bytes, and the limit for Oracle 11 and earlier versions is 4000 BYTES - no characters.

    If your characters each require 4 bytes you can store only 1,000 of them in a VARCHAR2 (4000).

    Refer to the section of the doc language SQL VARCHAR2 data type

    http://docs.Oracle.com/CD/B28359_01/server.111/b28286/sql_elements001.htm

    Regardless of the maximum length in characters, the length of VARCHAR2 data must not exceed 4000 bytes.

  • ColdFusion will not display unicode (utf-8) characters

    I have a very basic page with some characters unicode in it. ColdFusion cannot correctly display them. If I re - save as .html page (so the coldfusion server does not handle it), characters appear very well.

    Here is my page. Note that the character set is set to utf-8.

    I use Dreamweaver CS5.5. Running IIS 7 and CF 9.

    The text ' why this work ' has an intelligent apostrophe IS NOT DISPLAY CORRECTLY when it is run through CF. I searched around and I see is that the CF has "enabled by default" unicode, but not where to find where make them you defined.

    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""

    < html >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 ">"

    < title > Untitled Document < /title >

    < / head >

    < body >

    Why is it not work?

    < / body >

    < / html >

    > I already have the charset themy document, why I have to put again?

    To be clear, these are two different things.  Set the encoding theyour document is for the web browser to know how to display the content. Definition of the processing directive is to say SEE how to compile the file. They are very different things for different purposes and, for some reason, cannot always match.

    You can try to change the default value that uses Java. Try adding to your Java settings in the ColdFusion Administrator:

    -Dfile.encoding = UTF8

    Jason

  • Multilingual in XMLTYPE problem

    Hi Experts,

    My database as follows:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    WE8ISO8859P1 NLS_CHARACTERSET

    IM XML storage in one of the table in my database in the XMLTYPE column. But when my XML node contains a multilingual value (Ex: Chinese) is to show the Junk value. Is it possible to store it's?

    INSERT IN web_xml_file (file_no, web_file_data, record_status, user_created, created) VALUES (v_file_no, xmltype.createxml (p_in_xml), "UNP", USER, SYSDATE);

    NUMBER FILE_NO,

    XMLTYPE OF the WEB_FILE_DATA,

    RECORD_STATUS VARCHAR2 (3),

    MSG_ERREUR VARCHAR2 (4000).

    USER_CREATED VARCHAR2 (50).

    DATE OF CREATION,

    USER_CHANGED VARCHAR2 (50).

    MODIFICATION DATE

    The following seems to work but be aware, that this is still a hack and certainly not bulletproof.

    The best way to handle this is to have the AL32UTF8 migrated db character set, or the external analysis.

    Select utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (skywardsnumber), 'AL32UTF8') as skywardsnumber

    utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (title), "AL32UTF8") as the title

    utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (firstname), "AL32UTF8") as a first name

    utl_i18n.raw_to_nchar (utl_i18n.string_to_raw (familyname), "AL32UTF8") as familyname

    from xmltable ('/ data/passengerinformation ')

    from xmltype (dbms_xslprocessor.read2clob ('XML_DIR', 'multi.xml', nls_charset_id('CHAR_CS')))

    path of columns skywardsnumber varchar2 (100) 'skywardsnumber '.

    , title varchar2 (100) path 'title '.

    , path of varchar2 (100) firstname "firstname".

    , familyname varchar2 (100) path "familyname".

    ) x ;

    Explanations:

    (1) I put your example of XML in a file saved with UTF-8 encoding and it shipped to a database directory (DOC_DIR).

    (2) I have access to the file as CLOB using DBMS_XSLPROCESSOR.read2clob, and (here's the trick) considering the file in the db character set (mine was WE8ISO8859P15). Accordingly, all multibyte characters are converted into single-byte characters in the DB character set.

    (3) I use the XMLType constructor to construct an instance of XMLType off the CLOB and analyze with XMLTABLE.

    (4) who gives me four columns which I then convert into sequences of bytes (utl_i18n.string_to_raw) and finally to NCHAR (utl_i18n.raw_to_nchar) by specifying the encoding of the original file.

  • Roku or Amazon streaming stick does ' t connect to the router WNDR3400

    I have a router WNDR3400 wireless and have problems connecting to a media streaming device. I tried a Roku and Amazon streaming the stick. During installation, the Unit continuously can see my wireless network, after entering my password (set to WPA2-PSK) network the device continuously fails to connect. I tried to turn off security (only as a test, would not keep my network open), but get the same result, a connection failure.

    I've never had this problem with another PC devices, ipads, iphones and android phones, and a DVD player to connect it all and run normally to the router. Would appreciate suggestions on how to correct this problem. I bought my router in 2012, so I have to pay for the support of Netgear, I'd rather have a new router instead. Thank you.

    Frustrated customer

    Try to change the wireless password to something simpler. Perhaps, the Roku or Amazon can't handle special characters. Don't forget that Wi - Fi passwords are case-sensitive.

    Hmm, your original post says that they cannot connect without security at all. It's really weird. Try to perform a factory reset.

  • SEQ file created via V2013 cannot open with V2014?

    Hello, I created a file .seq with V2013 edit sequence without protection, but this file cannot be opened with the editor spequence of V2014 in another computer and display a dialog below: :-17100 error code

    Is it on two different computers or on the same computer? If it is two different machines, it is possible that your region on your operating system settings are defined differently from the default language to use for non-unicode programs? If so, try setting the TestStand 2014 machine to match the settings of the machine of TestStand 2013. Also, make sure that the Option on the location tab has the same settings to "Recognize multibyte characters" on both machines.

    Hope this helps,

    -Doug

  • Why teststand cannot display the ASCII character which number up to 128?

    Hi all

    I encountered a problem on an application for ASCII characters, why teststand cannot display the ASCII character which number up to 128?

    For example: an expression Local.xx = Chr (164).

    XX--> chain, can't do the correct string.

    An idea for this?

    OS: WinXP, SP1 Teststand2012.

    Thank you very much.

    TestStand uses encodings multibyte code page, that you have defined for the operating system-based. If you are using a code page that requires multibyte characters, you should also make sure that you have the Options of Station-> location-> parameter Regcognize multi-byte characters is enabled.

    On Windows 7, at least, the code page of the operating system setting is located in the control panel "Region and language" in the "Administration" tab where it says "language for non-Unicode programs".

    Hope this helps,

    -Doug

  • error file name of report with the Chinese Date format

    Hello

    I see an error in the DUT report stage writing in the standard template files.  This step is calling the API method save on the Runstate.Report object.

    This problem occurs on computers using localization in Chinese with the date in the name of the report file.

    Is this a known issue?  Is it possible to change the name of the file before calling the method above to eliminate the problem?

    Mike,

    You have the ability to recognize characters multi-byte enabled? Please navigate to configure"Station and select the location tab. There should be a checkbox to recognize multibyte characters. This box is checked? Otherwise, try to check the box and re-run your movie file.

    Please let me know the results of this test. Thank you!

  • Problem with parsing XML with html as part of the node content

    Hi all

    I am facing problem with XML parsin when the node has a HTML content, if the node does not have any html content then it works fine. Similar analysis logic works for Java Standard, but not for the Blackberry API. I have an obligation to remove not HTML content prior to analysis. As that would display in the browser.

                              String xml="" +
                    "<p> Dummy content </p> " +
                    "" +
                    "";
                              DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder dBuilder;
                Document doc;
                bis = new ByteArrayInputStream(xml.getBytes("UTF-8")); 
    
                dBuilder = dbFactory.newDocumentBuilder();
    
                doc = dBuilder.parse(bis);
                doc.getDocumentElement().normalize();
    
                NodeList nList = doc.getElementsByTagName("disclaimer");
    
                Element activeTagElmnt = (Element) nList.item(0);
                NodeList activeTag = activeTagElmnt.getChildNodes(); 
    
                tagValue=((Node) activeTag.item(0)).getNodeValue();
                              System.out.println(tagValue); //This prints "<" with HTML content. If i remove HTML then "Dummy Content" is printed
    

    If I need to remove html content, then I would need to reformat the content according to the HTML as the newline to a linebreak.

    Any suggestions would be helpful.

    Thank you

    Sandeep

    I feel xml parser was mature enough to handle these characters if sills, you get the error explore CDATA. It might help you.

  • Deciphering GIS RegEx

    I need corrective help on the use of regular expressions in integrated sigs.

    In particular, I am referring to the expressions used in the GIS 3115 (Sendmail header overflow). I see many false positives and I try to understand what the signature is looking for.

    These are the expressions:

    (\x3c >) {20}

    \x26lt;>\x26lt;>\x26lt; >...

    Can you help me?

    Thank you

    Don

    Your expressions above, I guess you are using sensors 4.x and look subsignature 3 of the signature 3115. This signature is looking for the following:

    (<>){20}

    It is essentially"<><><>... "repeated 20 times or more. "" (\x3c >) {20} "is the same thing as above. \x3C is the same as "<". we="" had="" to="" do="" this="" because="" of="" a="" regex="" quirk.="" the="" "\x26lt;="">\x26lt;>\x26lt;" >... "" should look to "<><><>... ». He is a victim of our XML data file that can not handle some characters correctly. This is a bug of display. I'll look to this problem.

    Regarding false positives, if you can capture a few iplogs and send them to [email protected] / * /, I'll look into the cause. I need to see the traffic to say what exactly happens.

  • How to normalize/linearize whitspace in XML attributes?

    Hello

    I have data in a CLOB column I need to appeal to an XML attribute. The data may contain CR, LF and tabs - that the XML must be preserve way standardized/linearized (that is to say using & #10; & #13; etc.)

    I tried using XMLROOT - it deletes the line a total break.

    I tried to use XMLSERIALIZE - when finished with clause VERSION it also suppresses the newline, when without the VERSION, it keeps the jump line but not standardized.

    Do not use these preserves the jump line - but not standardized.

    Is there a bed in order to standardize XML - or should I use replace nested?

    Examples below.

    Thanks in advance.

    SQL> set long 20000
    SQL> set lines 1000
    SQL> set pages 1000
    SQL> select * from v$version
    
    
    BANNER                                                                          
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production    
    PL/SQL Release 11.2.0.3.0 - Production                                          
    CORE 11.2.0.3.0 Production                                                      
    TNS for Linux: Version 11.2.0.3.0 - Production                                  
    NLSRTL Version 11.2.0.3.0 - Production                                          
    
    
    5 rows selected.
    SQL> -- as XMLTYPE, newline (chr(10)) is preserved, but not normalized
    SQL> select XMLELEMENT("A",
            XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                     )
    from dual
    
    
    XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT"))
    ---------------------------------------------------------
    <A ID="1" TXT="2                                         
    3"></A>                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> -- as CLOB, newline (chr(10)) is preserved, but not normalized
    SQL> select XMLELEMENT("A",
            XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                     ).getclobval()
    from dual
    
    
    XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")).GETCLOBVAL()
    ----------------------------------------------------------------------
    <A ID="1" TXT="2                                                      
    3"></A>                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> -- with XMLROOT - newline is removed
    SQL> select XMLROOT(
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      ),
                   VERSION '1.0')
    from dual
    
    
    XMLROOT(XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")),VERSION'1.0')
    -------------------------------------------------------------------------------
    <?xml version="1.0"?>                                                          
    <A ID="1" TXT="2 3"/>                                                          
                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> --with XMLSERIALIZE without VERSION clause - newline is preserved but not normalized
    SQL> select XMLSERIALIZE(DOCUMENT
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      )
                       )
    from dual
    
    
    XMLSERIALIZE(DOCUMENTXMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")))
    -------------------------------------------------------------------------------
    <A ID="1" TXT="2                                                               
    3"></A>                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> --with XMLSERIALIZE with VERSION clause - newline is removed
    SQL> select XMLSERIALIZE(DOCUMENT
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      )
                       VERSION '1.0')
    from dual
    
    
    XMLSERIALIZE(DOCUMENTXMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT"))VERSION'1.0')
    -------------------------------------------------------------------------------------------
    <A ID="1" TXT="2 3"/>                                                                      
    1 row selected.
    SQL> --doing replace works, but seems "un-natural" and very inefficient
    SQL> select replace(
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      ),
            chr(10),'&#10;')
    from dual
    
    
    REPLACE(XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")),CHR(10),'&#10;')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <A ID="1" TXT="2&#10;3"></A>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    

    Question still pending, if anyone has another way - or knows for sure replace is the only option.

    Replaces nesting calls is probably the only option, of course, but not the way you have tried in your examples.

    Do replace it at an earlier stage, directly on the data source.

    Here's how I'd do:

    SQL> set define off
    SQL>
    SQL>
    SQL> select xmlserialize(document
      2           xmlelement("A",
      3             xmlattributes(noentityescaping
      4               1 as id
      5             , replace(
      6                 dbms_xmlgen.convert('X'||chr(10)||'Y')
      7               , chr(10)
      8               , '
    '
      9               ) as txt
     10             )
     11           )
     12           no indent
     13         )
     14  from dual ;
    
    XMLSERIALIZE(DOCUMENTXMLELEMEN
    --------------------------------------------------------------------------------
    
    

    1. use DBMS_XMLGEN. CONVERT to handle reserved characters.

    2-using REPLACE to manage a specific entity escape

    Option NOENTITYESCAPING 3 - use to keep the entity references comes to be presented

Maybe you are looking for