<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Remove Accented Characters from a string in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821020#M4851863</link>
    <description>&lt;P&gt;I guess the &lt;A href="http://dcx.sap.com/index.html#1201/en/dbreference/csconvert-function.html*d5e13912"&gt;CSCONVERT function&lt;/A&gt; may be of help here.&lt;/P&gt;
&lt;P&gt;UPDATE:&lt;/P&gt;
&lt;P&gt;Say, converting to ASCII will turn accented characters into their unaccented base version - however it may also replace other characters by probably undesired results:&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select cast(csconvert('àéêöhello!', 'ascii') as varchar)&lt;/LI-CODE&gt;


&lt;P&gt;returns "aeeohello!" as desired but a test with German unlauts reveals a misfit for the "ß":&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select cast(csconvert('aäboöuüssßÄÖÜ', 'ascii') as varchar)&lt;/LI-CODE&gt;


&lt;P&gt;returns "aaboouuss\x1aAOU" (note: The character before the upper "A" is ASCII 26 and is not dispalyed here as a non-printable char).&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Aside: What I had originally in mind with my suggestion was some kind of "collation tailoring" with csconvert(), i.e. using something like "AccentSensitivity=ignore" in the target charset.&lt;/P&gt;
&lt;P&gt;For example you can use collation tailoring to ignore or respect accents when doing comparisons:&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select compare('àéêöhello!', 'aeeohello!', 'uca(AccentSensitivity=ignore)'), compare('àéêöhello!', 'aeeohello!', 'uca(AccentSensitivity=Respect)')&lt;/LI-CODE&gt;


&lt;P&gt;returns 0 (= identical) vs. 1.&lt;/P&gt;
&lt;P&gt;However, this will not work here as csconvert() uses a charset (and not a collation) as its arguments.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2015 16:31:19 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2015-10-07T16:31:19Z</dc:date>
    <item>
      <title>Remove Accented Characters from a string</title>
      <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaq-p/13821019</link>
      <description>&lt;P&gt;Is there a simple way to remove accented characters from a string?&lt;/P&gt;
&lt;P&gt;For example àéêöhello! needs to be converted to aeeohello!&lt;/P&gt;
&lt;P&gt;In SQL server I would use Collate to accomplish this in one line.  However, I am not able to find a solution that is working other than using multiple replace statements or something of the sort.&lt;/P&gt;
&lt;P&gt;This is in a database where multiple languages are used and stored.  I need to convert Portuguese to English when the data is being exported, but don't have the budget for a translator.&lt;/P&gt;
&lt;P&gt;Your help is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 15:57:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaq-p/13821019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-07T15:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Accented Characters from a string</title>
      <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821020#M4851863</link>
      <description>&lt;P&gt;I guess the &lt;A href="http://dcx.sap.com/index.html#1201/en/dbreference/csconvert-function.html*d5e13912"&gt;CSCONVERT function&lt;/A&gt; may be of help here.&lt;/P&gt;
&lt;P&gt;UPDATE:&lt;/P&gt;
&lt;P&gt;Say, converting to ASCII will turn accented characters into their unaccented base version - however it may also replace other characters by probably undesired results:&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select cast(csconvert('àéêöhello!', 'ascii') as varchar)&lt;/LI-CODE&gt;


&lt;P&gt;returns "aeeohello!" as desired but a test with German unlauts reveals a misfit for the "ß":&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select cast(csconvert('aäboöuüssßÄÖÜ', 'ascii') as varchar)&lt;/LI-CODE&gt;


&lt;P&gt;returns "aaboouuss\x1aAOU" (note: The character before the upper "A" is ASCII 26 and is not dispalyed here as a non-printable char).&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Aside: What I had originally in mind with my suggestion was some kind of "collation tailoring" with csconvert(), i.e. using something like "AccentSensitivity=ignore" in the target charset.&lt;/P&gt;
&lt;P&gt;For example you can use collation tailoring to ignore or respect accents when doing comparisons:&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select compare('àéêöhello!', 'aeeohello!', 'uca(AccentSensitivity=ignore)'), compare('àéêöhello!', 'aeeohello!', 'uca(AccentSensitivity=Respect)')&lt;/LI-CODE&gt;


&lt;P&gt;returns 0 (= identical) vs. 1.&lt;/P&gt;
&lt;P&gt;However, this will not work here as csconvert() uses a charset (and not a collation) as its arguments.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 16:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821020#M4851863</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-10-07T16:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Accented Characters from a string</title>
      <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821022#M4851865</link>
      <description>&lt;P&gt;Quite an interesting solution. Here was my request:&lt;/P&gt;
&lt;P&gt;select 'aáéíóúb' as a, TO_CHAR(CSCONVERT(a, 'ASCII'))&lt;/P&gt;
&lt;P&gt;And this was the response:
aáéíóúb,a\x1a\x1a\x1a\x1a\x1ab&lt;/P&gt;
&lt;P&gt;What is funny is that the characters between a and b are displayed as spaces (indeed they are a\\x1a\\x1a\\x1a\\x1a\\x1ab).
Internet suggests a more generic solution: &lt;A href="http://stackoverflow.com/questions/4024072/how-to-remove-accents-and-all-chars-a-z-in-sql-server"&gt;http://stackoverflow.com/questions/4024072/how-to-remove-accents-and-all-chars-a-z-in-sql-server&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 05:28:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821022#M4851865</guid>
      <dc:creator>Vlad</dc:creator>
      <dc:date>2015-10-09T05:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Accented Characters from a string</title>
      <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821023#M4851866</link>
      <description>&lt;P&gt;Hm, I like your answer. But I do not know, why when I use TO_CHAR, I get a different result. Should I use CAST instead?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2015 16:07:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821023#M4851866</guid>
      <dc:creator>Vlad</dc:creator>
      <dc:date>2015-10-12T16:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Accented Characters from a string</title>
      <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821024#M4851867</link>
      <description>&lt;P&gt;Well, as you do use the TO_CHAR() function without its second parameter, as to the docs, it should exactly do the same as a cast (though to char instead to varchar but that should not matter) - from the docs:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If source-charset-name is not specified, then this function is equivalent to:   &lt;/P&gt;
&lt;P&gt;CAST( string-expression AS CHAR );&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Possibly we both do use a different database charset ("Windows-1252" in my case)?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 02:22:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821024#M4851867</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-10-13T02:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Accented Characters from a string</title>
      <link>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821021#M4851864</link>
      <description>&lt;P&gt;Just a very wild guess:&lt;/P&gt;
&lt;P&gt;AFAIK collation tailoring is based on the &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbadmin/natlang-s-7944836.html"&gt;ICU library&lt;/A&gt; used within SQL Anywhere (dbicu.dll).&lt;/P&gt;
&lt;P&gt;As &lt;A href="http://site.icu-project.org/"&gt;ICU&lt;/A&gt; does also allow to transform data (including decomposition of characters), you might be able to make use of the ICU library yourself. That may be more reliable than a home-brewn list of "special characters to convert".&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 03:17:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/remove-accented-characters-from-a-string/qaa-p/13821021#M4851864</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-10-13T03:17:41Z</dc:date>
    </item>
  </channel>
</rss>

