Solved

SQL convert diacritic to anglicized form

Posted on 2011-09-20
6
989 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now