Searching for accented characters

Posted on 2003-03-12
Medium Priority
Last Modified: 2013-12-03
Hello all,

I have a search form where users can search by clients' first and last names. As quite a lot of the clients are foreign, I need to automatically search for accented characters as well. ie if the user enters Fred for first name and Surname for surname the results sould show eg.

Fred Surname
Frèd Sûrnamë
Frêd Súrname

for all the diffirent possible accented characters. All I can think of is to check the search string for a character that could have an accented character and then repeating the search for all possible combinations, but this seems very cumbersome and slow. Does anyone know of an easy way to do this?
Question by:cpk68
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

Author Comment

ID: 8120682
I see that in posting the question, the accented characters have been changed. The names should all be "Fred Surname", but with accented characters, which is what I want to search for, Not as they appear above.

Expert Comment

ID: 8121879
I'm not sure I understand the question entirely, but perhaps you could search the names without the accented characters and then only check for the accents in that result set, which would presumably be smaller.

Does the search treat a e with an accent the same as it does an e without an accent?


Accepted Solution

dmang earned 400 total points
ID: 8122686
Here's a thought ..

Try replacing all the potentially accented characters in the name with a "wild card" character, and then use the result for your lookup using "LIKE".

This is from a simple form with two text boxes, and a commandbutton.
Enter the name in textbox1, click the command, and the search string will show in textbox2.

(* for DAO, % for adodb)

Private Sub Command1_Click()

    Dim c As Integer
    Dim t As String
    Dim l As Integer
    c = 1
    For c = 1 To Len(txt1.Text)
        t = Mid$(txt1.Text, c, 1)
        Select Case t
            Case "A", "a", "E", "e", "I", "i", "O", "o", "U", "u", "C", "c", "N", "n", "Y", "y"
                t = "*"
        End Select
        txt2.Text = txt2.Text & t
    Next c

End Sub
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 8126610
Thanks for your replies.

Slingblade: ideally I'd like to have the search treat an "e" with or without an accent the same. i.e. searching for "Fred" will bring up all the "Fred"s irrespective of whether there is an accent on the "e" or not. I don't want the user to have to type an accented character for the search to find accented characters.

dmang: I see what your getting at, but replacing the "e" in "Fred" with a wildcard will cause the search results not to be entirely accurate either. When searching for "Fred" the results could contain names like:

"Frud", Frxd" etc.

which I'd like to avoid.

The only other solution I can think of is removing the accented characters when the user enters the name and saving 2 firstnames and 2 last names for each client. Then using the one without accents for searching and the one with accents for displaying. I'd prefer not to do that though.

Any other suggestions?

Expert Comment

ID: 8135933
When you are searching proper names, you're only going ot get back so much..

Put the results in a list, and present them to the user to make the final decision...

Even without accented characters, you're likely to return multiple instances (i.e. John Smith)

Expert Comment

ID: 9056399
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

764 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