jquery autocomplete

Below is some jquery code which uses autocomplete to supply a user with a list of artist names. It works correctly except when there is an accent in the name. (for example Jiménez will not be in the list if you type "Jime...). I think I have to add an accent map but since I'm using a file, autocompleteArtist.cfm,which returns the data,  rather than a variable with some text names,  I'm not sure what the code should be with the accent map.
Here is what I have:
<script type="text/javascript">
                  // autocomplete typeahead additions
       	          $(document).ready(function() {
			
	            $("#txtArtistName").autocomplete({
                source: "autocompleteArtist.cfm",
	                minLength: 2,
					delay:0
	                
	            });
	        });                               
  	</script> 

Open in new window


Can someone tell me what the code should be to display accents here?
Thank you.
cbeverlyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
you're not using UTF8 anywhere, it's time to update your database character set, good luck, backup first
0
_agx_Commented:
(no points... I don't have answer)

@leakim971 - Sounds like more than just a simple encoding question. If I'm understanding correctly, when a user types a word with "e" (ascii 101), they want it to actually match words with "é" (ascii 138 ?) too. That shouldn't normally work because they're 2 totally different characters.  

Not sure if that's possible or if it is  - how it could be done :)
0
cbeverlyAuthor Commented:
Yes, you are correct - when a user types a normal e they want it to match with é. So if they type "Jimenez" they want it to match Jiménez. I think I have to use an accent map but don't know how to get it to work with the autocomplete method I'm using.
0
_agx_Commented:
It sounds like there are two parts to this: server and client side. The db query itself has to account for "e" vs "é". Otherwise it won't return "Jiménez" to the jquery function in the first place. So I think you need more than a client side map..

Honestly, I'm not sure if there's a simple way to do that in SQL. You might want to ask someone in the MySQL zone. (I'd leave CF out of it, so as not to discourage folks unfamiliar w/CF. Plus it is really a SQL question). Just explain you're running a query that's used for an autocomplete feature. You'd like the parameter "Jime%" to also match Jiménez". Ask if there's a way to handle that:

     ie   Where "'Jime" is a variable parameter

               SELECT  ColumnA, ColumnB
               FROM     SomeTable
               WHERE  ColumnA LIKE 'Jime%'
0
_agx_Commented:
> Otherwise it won't return "Jiménez"

Hm... that may not be entirely correct.  I was reading this (old) thread which mentions collation. Apparently the results depend on the collation of your column.  In this sql fiddle, the "é" is treated just like "e". I don't know if changing the collation has any negative impact, but .. if that does the trick for the db side, then you just need to figure out the client side/javascript mapping.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.