?
Solved

SQL convert diacritic to anglicized form

Posted on 2011-09-20
6
Medium Priority
?
1,035 Views
Last Modified: 2012-05-12
Hello All,

We need to convert diacritic supplied by the front end to anglicized form to search

For example:

(ÀÖÙãas) to (AOUaas), because the database column we have does not contain diaciritc, so we if user added a diacritic character we need to search with non diacritic form.

Please help

Thank you
0
Comment
Question by:dojjol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 15

Expert Comment

by:x77
ID: 36567870

  S has 6 chars.
  Normalized string has 10 chars. Each diacritic char is decomposed.

  I added all chars from s1 to Sb except NonSpacingMark chars.
Dim s = "ÀÖÙãas"
     Dim s1 = s.Normalize(NormalizationForm.FormD)
     Dim sb As New StringBuilder(s.Length)
     For Each c In s1
         If Char.GetUnicodeCategory(c) = Globalization.UnicodeCategory.NonSpacingMark Then Continue For
         sb.Append(c)
     Next
     Debug.Print(sb.ToString)

Open in new window

0
 

Author Comment

by:dojjol
ID: 36567906
thank x77, is it a stored procedure?
0
 
LVL 15

Expert Comment

by:x77
ID: 36567932
Sorry.

SELECT CONVERT('Ä Ê Í Õ Ø A B C D E','US7ASCII','WE8ISO8859P1')
FROM DUAL;
A E I ? ? A B C D E

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:x77
ID: 36567951
SELECT CONVERT('ÀÖÙãas','US7ASCII') FROM DUAL;    ->AOU?as
0
 

Author Comment

by:dojjol
ID: 36568308
thanks again, but we missed 'Ù' and is replaced as '?' in AOU?as, so not really sure this will work for me
0
 
LVL 15

Accepted Solution

by:
x77 earned 2000 total points
ID: 36568574
Yes, I see on my machine that "Õ" Translates to ?, But I am work with Spanish.

You can try a char_set_from that contains this leter.
http://www.techonthenet.com/oracle/functions/convert.php

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question