Replacement of special characters through hex-code

Hi,
I create a xml-output via SYS_XMLTYPE- and XML_ELEMENT-functions. In the coulumn values I select special XML-Characters like the ampersand will be automatically replaced through their quivalent Escape code (&) - But our special german characters (ä, ü, ö, ß) won't be replaced. Is there a function to replace them or do I have to write my own function?
Bye,
Jens

Hi Mark,
now I have a problem with the replacement (You must replace $ through an ampersand to understand the code, the ampersand would be automatically replaced)
The following query:
SELECT XMLELEMENT( "city", a.city,
XMLELEMENT( "company", a.company )
) AS XML_DATEN
FROM (
SELECT 'München' AS CITY, 'MCM' AS COMPANY
FROM dual
UNION
SELECT 'Hamburg' AS CITY, 'P$C' AS COMPANY
FROM dual
) a
returns
<city>Hamburg<company>P$amp;C</company></city>
<city>München<company>MCM</company></city>
Ok, that's fine. The XMLELEMENT function automatically replaces the ampersand. But the "ü" do I have to replace for myself.
But when I do it:
SELECT XMLELEMENT( "city", REPLACE( a.city, 'ü', '$#'||ASCII('ü')||';' ),
I got the following:
<city>M$amp;#252;nchen<company>MCM</company></city>
And not:
<city>M$#252;nchen<company>MCM</company></city>
How can I solve this problem?

Similar Messages

  • Replace function - special characters

    Hi All,
           If my column is encountering special characters I would like to replace with blank. Special characters may vary from record to record. Sometimes it is @ sometimes $,!,,$,^,<,&,<,>,?,",{,},+,_,),(.
    Do we have any function same like replace that can replace all special characters, whatever it encounters with required value?
    - please mark correct answers

    Take a look at this article
    T-SQL:
    How to Find Rows with Bad Characters
    and check See Also section in that article for more articles on that topic.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles
    Thanks Naomi
    - please mark correct answers

  • Replace all special characters in a String with underscore

    I have a String which contains some special characters even(!,$,@,*....).
    I need to replace all the special characters with _ in my String. I do have an idea of using String.replace() and analogous forms, but I would be thankful if anyone can suggest me of a better and an efficient way.
    regards,
    fun_one

    Kaj,
    Thx for your earnest reply. I did have a peep into the API on this method. But the regular expression that I need to use here was beyond my understanding. It did specify some regex that I put to use (something like myString("\D","_"), assuming that I need to replace all non-digit characters ), but it really did not help me getting the result.
    Would you spare some code for me reg. the usage of regular expressions in such a scenario?
    cheers,
    fun_one

  • Special characters through gateway !

    Hi,
    I've a portlet. In Edit->preferences, I've a textarea where user can enter <HTML> content. If user enters " " for a extra space and hit finish, it is replaced by junk character like "__" . Response.Type="text/html".
    I'm using GDK.

    Hi Harmony,
    You dont have to worry about the conversion you can directly import the data through Import Manager.
    I assume that your source is excel and will let you know the import step for this
    1) Open the Import Manager
    2) Select the Source, Source can be anything like Excel/Delimited Text or Fixed Text ( If it is text delimited than please specify the delimiter as well)
    3) if source is in Excel then just import it and then map the fields ( Please change the data type of that particular column to Text in your excel so that excel does not change any data value automatically)
    4) Once the mapping is done please import the data and check it would have special characters as well.
    Note : Filed size at source as well as destination should match or destination should have more size so that it does not truncate the data value.
    Let me know if it does not works
    Thanks and Regards
    Praful

  • Handling special characters through proxy

    Hi Gurus,
    we hvae a scenario sap to file, sending material information from SAP through outbound prpxy and palcing that detaisl in FTP loation using file adapter.
    Here probelm is one of the fields desc and text we are passing material Description and basic text which may have special characters like # @  µ while these cahractrs coming to XI itselfthey are convering as #0 and giving soem fatal error in XI whaich is unabel to parse in XI mapping and end up with mapping error.
    One more thing the if i use test the interface in dev and qa with the same characters these are working fine only failing in prod.
    please suggest how to procedd furthur.. whhetehr there is any place to check this special charatcres ecoding, uncode maintned at r/3 side or side side.
    here is the error
    Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser : #0 not allowed in Character data sections(:main:, row:1, col:1607794) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:157) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:770) Root Cause: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser : #0 not allowed in Character data sections(:main:, row:1, col:1607794)(:main:, row=1, col=1607794) ->
    Edited by: Jitender Devunuri on Oct 26, 2009 3:33 PM

    Hi all .... any idea

  • How to replace XML special characters using Xpress e.g. ' = '

    Hellos
    I need to write some XML built from resource data.
    The resource data strings can contain anything e.g. & ' " < and > characters.
    How do I replace these characters with the strings & &apos; " etc.... from within Xpress?
    I try something like:-
    <set name='testchar'>
    <switch>
    <ref>thisLetter</ref>
    <case>
    <s>'</s>
    <s>&apos;</s>
    </case>
    <case>
    <s>"</s>
    <s>"</s>
    </case>
    <case default='true'>
    <ref>thisLetter</ref>
    </case>
    </switch>
    </set>
    But when saved the <s>&apos;</s> gets saved as <s>'</s>
    Is this impossible with Xpress forcing me to invoke my own Java class? (which is a pain to do because of internal politics re restarting of App Server).

    Hmmmm seems there is transformation in this set up too.
    What I am trying to do is to parse a string which may or may not contain XML special characters into an XML acceptable string.
    e.g. transform the surname O'Connor into O&apos ;Connor (with no embedded blank)
    I wish to write a rule which uses XPress language to achieve this.
    I want to convert the character ' into the string &apos ; (with no blank between apos and ;) and similar for the other XML specials.
    Is this possible?

  • Retrieving special characters through an HttpRequest

    Why I can not retrieve special characters like accents, spanish chars, etc. through an HttpRequest? Instead of the special char I want to retrieve it always changes them to another symbol. For example (ni�o, informaci�n)
    Is there any way to do it?
    Thanks in advance

    The HTTP specifications say that data sent through HTTP must be in ASCII. Those accented characters are not in the ASCII character set, so when you ignore the rule and send them anyway, they become mangled. You'll observe that this forum has the same problem.
    The HTTP specs do provide a way to send non-ASCII characters, though, through some kind of escaping or encoding. You could look it up, they are in an RFC on the Internet somewhere. However, you are probably asking about characters that are sent to you by some agent (probably a browser) that you do not control.

  • How to replace special characters with html code characters automatically?

    A colleague and I work on these html pages. They eventually end up as emails, but we have the cold fusion server to pre process them. One thing we are trying to do is eliminate problems caused by unencoded copyright, trademark and smart quote symbols.
    How could I create an array of find / replace commands in the header so it processes the HTML with correct character codes.
    I"m not cold fusion aware, so any kind of starter info would be great. Eventually I might add more replacements to the array.
    As an example TM (font character) would process to &trade; and a smart quote or apostrophe would process to a straight one. an en dash character would become &ndash;
    Because we copy paste from places, this often happens and it seems like cold fusion could solve the problem quickly and repeatedly all at once.
    thanks for any help
    -smick

    CF has a built in HTMLEditFormat function for handling <  &  > characters.  For handling trademark and smart quote characters you might try searching for a user defined function at http://cflib.org or writing a user defined function yourself that will handle the specific characters needed in your application.

  • How to check special characters in java code using Java.util.regex package

    String guid="first_Name;Last_Name";
    Pattern p5 = Pattern.compile("\\p{Punct}");
    Matcher m5 =p5.matcher(guid);
    boolean test=m5.matches();
    I want to find out the weather any speacial characters are there in the String guid using regex.
    but above code is always returning false. pls suggest.

    Pattern.compile ("[^\\w]");The above will match any non [a-zA-Z0-9_] character.
    Or you could do
    Pattern.compile("[^\\s^\\w]");This should match anything that is not a valid charcter and is not whitespace.

  • How to replace special characters in Purchase order item text in ECC 6.0

    Hi All,
    Now i am working in ECC environment.
    I am unable to replace the special characters in the PO short text for example take the following text.
    Job#Burst Fire 3930-00092#Heater Control
    here i want to replace # symbol with space.
    i used  replace all occurences, find , transfer, overlay keywords to replace thta special characte but it is not replacing that character.
    i used replace_string FM also.it is also not working.
    please help me out in this. points will be rewarded.

    Hi Praveena,
    what replacement(s) did you try?
    Please
    replace all occurrences of
    CL_ABAP_CHAR_UTILITIES=>newline
    CL_ABAP_CHAR_UTILITIES=>cr_lf
    CL_ABAP_CHAR_UTILITIES=>form_feed
    CL_ABAP_CHAR_UTILITIES=>horizontal_tab
    CL_ABAP_CHAR_UTILITIES=>vertical_tab
    CL_ABAP_CHAR_UTILITIES=>backspace
    CL_ABAP_CHAR_UTILITIES=>minchar
    CL_ABAP_CHAR_UTILITIES=>maxchar
    minchar is HEX u201900u2018 in non-Unicode systems, U+0000 in Unicode systems
    maxchar is HEX  Xu2018FFu2018 in non-Unicode systems, U+FFFD in Unicode systems
    If it still does not help, check the remaining # characters in debugger, switching to hex mode: Then you may see what it is.
    Regards,
    Clemens

  • Replace Special Characters in a string + XQUERY

    Hi All,
    I am using the following replace function to replace the special characters in my XQUERY.
    *replace($string1, '[&"-*;-`!|:,¿/{}@#$%^*~()_+-]', ' ')*
    Fortunately it is replacing all the special characters. But the only problem here is it is even replacing capitol letters in to spaces, which I don't want.
    Please help me out!!

    Hi
    <<< What did u change >?> I dont see any change with the Regex ?  >>
    if you observe in the modified function, he just removed (*) inside the replace funtion.
    Thanks
    Shankar AUNV

  • Search & Replace special characters?

    Is there a way to search & replace for special characters, such as paragraph or tab marks?

    Not in Pages 5.2 because Apple made it new and improved.
    However both Pages '08 and Pages '09 can search on invisible characters, precisely because they are not new and improved.
    Peter

  • Replace special characters in String

    Dear Guru ,
    Does SAP provide the standard function that can replace the special characters in String ?
    For example :
    I have one template string : " & & & & & output(s) have not been processed yet ! " and five parameters : "P1" , "P2" , "P3" , "P4" , "P5" .
    And i would like to apply all parameters into the string to replace the "&" character . Is it possibile ?
    My idea is sourcing from the Message String that in tcode : SE91 .
    Thanks .
    Best Regards,
    Carlos Zhang

    Hi Carlos,
    I think instead of a standard FM you can write a one line command to do this job.
    E.g. 
    constant: str1 type string value 'output(s) have not been processed yet ! '.
    data: var1 type c,
             var2 type c,
             var3 type c,
             var4 type c,
             str    type string.
    concatenate var1 var2 var3 var4 str1 into str separated by space.
    So str will have the final value.
    Thanks,
    Mainak

  • How to Handle Special Characters in PI7.1

    Hi Team,
    I need to handle some special characters like <,>,& etc.. from WS Adapter to CRM in PI 7.1.
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    By using the above blog i had implemented the Java Code as
    public void execute(InputStream in, OutputStream out){
    try{
    int read_data;
    while((read_data = in.read()) != -1){
    if (read_data == '&'){
    out.write("&amp;".getBytes());
    }else if (read_data == '>'){
    out.write("&gt;".getBytes());
    }else if (read_data == '<'){
    out.write("&lt;".getBytes());
    }else if (read_data == '/'){
    out.write("&frasl;".getBytes());
    }else if (read_data == '\''){
    out.write("&apos;".getBytes());
    else { out.write(read_data);
    out.flush();
    } catch (Exception e){}
    I had added this class file in Operational Mapping.
    It is working  if we have only one IF condition for & in while
    Any suggestion
    Thanks
    Sriram

    Hi Ramesh,
    Thanks for your inputs, I have tried your code but it is not working. The error message stays the same.
    Dear Stephane,
    To describe the error more, the requirement is the payload coming from source through WS Adapter consists of the special characters <, > , & which are basic sematics of XML syntax. I need PI to process this payload with special characters and successfully transfer it to target CRM system. I have created the Java class with code (ref: Blog 9420) as stated earlier and added this class to my existing Operation Mapping. I am expecting the java mapping to replace the special characters in payload like  < with "&gt;" . So as the case with the other characters >,&,'
    After activaton of my operation mapping, I triggered the test message with Soap UI client and I could able to get a successful mapping only When I put the logic for &ampersand symbol only. However when I am trying to add the logic for > or < or ' the mapping is failing . I am using UTF-8 encoding across the source and PI enviroments.
    Sample SOAP message :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:abcabca.com">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:MT_ABCDEFG_Req>
         <activity>
              <id/>
              <type>ZEMA</type>
              <actionType>C</actionType>
              <firewall>10000003</firewall>
              <subject>small &gt; &lt; attachment test</subject>
              <location/>
              <startDate>2010-07-08T10:53:31.000Z</startDate>
              <endDate>2010-07-08T10:53:31.000Z</endDate>
              <mainClient>1000319</mainClient>
              <mainContact>1000003</mainContact>
              <isConfidential>false</isConfidential>
              <summary/>
              <fullText>test body  - small.txt</fullText>
              <owner>1000021</owner>
              <from>ABCDEDF</from>
              <sendTo>emailaddress</sendTo>
              <copyTo/>
              <keywords/>
              <referenceId/>
              <createdBy>1000021</createdBy>
              <additionalContacts/>
              <additionalClients/>
              <additionalParticipants/>
              <status>A0008</status>
              <attachments>
                   <fileUrl>20100708110053-XXXXXXXXX</fileUrl>
                   <fileName>small.txt</fileName>
              </attachments>
              <attachments>
                   <fileUrl>20100708110053-XXXXXXXXX</fileUrl>
                   <fileName>EMail 2010-07-08.pdf</fileName>
              </attachments>
         </activity>
          </urn:MT_ABCDEFG_Req>
       </soapenv:Body>
    </soapenv:Envelope>
    Output on the SOAP UI  client for the above request:
    <!--see the documentation-->
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context>XIAdapter</context>
                   <code>ADAPTER.JAVA_EXCEPTION</code>
                   <text>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIServer:NO_MAPPINGPROGRAM_FOUND:
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1160)
         at sun.reflect.GeneratedMethodAccessor342.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(
    What do you think where I am doing the wrong?
    Sriram

  • How to handle special characters in NWDI

    Dear All
    I am trying to update the Description from JSP form. Through JCO we are calling the RFC of ABAP. We are passing these description from Java to RFC of ABAP and this RFC update the text in Database.
    We have noticed that if there is some special character in description like as : š or ž, complete description is not getting updated in to the SAP database.
    Can anyone help me how to handle these special characters in Java. There may be N number of special characters. We want to generalize it. We want to replace these characters by s and z respectively.
    For example : We want to update this description.
    APPLERR H'4301 H'FA03 H'254C na Zagreb TC4 riješen je cleaning procedurom, te je i kroz CSR odgovoreno da trap korekcija N01TCADG-0052 u bloku UPDC više nije potrebna, te se može izbaciti (AP143).
    Uspješno su završene HR17/CN-A3 FOA-e na tranzitnom nivou, te slijedi roll-out u dva termina 12/13.04 i 19/20.04. ETK je na sastanku isporu&#269;io SW, te ALEX i mini PLEX za sve objekte.
    AP147. Poslati finalnu dokumentaciju za uvo&#273;enje paketa (implementacijsku instrukciju i sve popratne datoteke).
    WHile updated text is as follows :
    APPLERR H'4301 H'FA03 H'254C na Zagreb TC4 rije
    N01TCADG-0052 u bloku UPDC vi
    Uspje
    sastanku isporu
    AP147. Poslati finalnu dokumentaciju za uvo
    Regards
    Bhavishya

    Hi Bhavishya,
    Apparently your SAP database isn't configured to support Unicode. That would be the first solution to your problem, but I can imagine it's a bit drastic to convert your DB.
    A second solution would be to encode the input description to ASCII before storing it in the database. When reading from the database, decode again to Unicode. This way, no information is lost. A suitable encoding would be Base64. e.g.
    String description = "šunday žebra";
    String descriptionBase64 = new sun.misc.BASE64Encoder().encode(
      description.getBytes("UTF-8")); // ""
    // store descriptionBase64 in the DB
    // later, when reading descriptionBase64 from the DB
    String description2 = new String(
      new sun.misc.BASE64Decoder().decodeBuffer(descriptionBase64), "UTF-8");
    Instead of using Sun's implementation, a better alternative is to use the open source implementation
    org.apache.commons.codec.binary.Base64 from Commons Codec . 
    The 3rd approach is indeed to normalize the description by replacing all special characters with their ASCII equivalent. A rather easy solution is as follows:
    String description = "šunday žebra";
    String descriptionNormalized = sun.text.Normalizer.normalize(
      description, sun.text.Normalizer.DECOMP, 0).replaceAll(
      "[^p{ASCII}]", "");
    sun.text.Normalizer decomposes the string, e.g. "éàî" becomes "e´a`i^", after which non-ASCII characters are being removed using a regular expression.Again, note that it's usually a bad idea to use sun.* packages, see note about sun.* packages. The above code only works with J2SE 1.4 and J2SE 5.0, but it breaks in J2SE 6.0 (where
    java.text.Normalizer became part of the public API ;-). A good open source implementation can be found here: ICU4J (com.ibm.icu.text.Normalizer). 
    Kind regards,
    /Sigiswald

Maybe you are looking for

  • Germany.vs.Brazil.Live.Stream.Online

    http://freerice.com/content-group/germanyvsbrazillivestreamonline http://freerice.com/content-group/germanyvsbrazillivestreamonline http://freerice.com/content-group/germanyvsbrazillivestreamonline http://freerice.com/content-group/germanyvsbrazilliv

  • IWeb not allowing me up update my site

    i've just updated my site on iWeb.  when i click "publish site" it asks me to login to mobileme but i'm already logged in and my account has been transferred to icloud. the publishing page shows that my idisk is full but my mobile me shows that i hav

  • Imac6,1 24" Display for new Mini

    Is it possible to use the Imac,6,1 as a monitor display for the new mac mini introduced today? The imac doesn't have enough horses to run Aperture well but otherwise works fine.

  • [SOLVED] Cannot upgrade system because of wlan

    Hi all, since 3 days i cannot upgrade my system because of broadcom wl dependencies and kernel version. I tried everything i know to fix this, but nothing happens. This is what i get when upgrading ┌─[smau @ neplero]-[~] └─[21:41:26]-[ $ ]> yaourt --

  • Life after the panic protocol

    We have 2 servers that run on GridGain containing Coherence distributed caches (version 3.4.1). The nodes in both servers are used for processing events. Those events are stored in the cache. When the network connection between server A and B fails,