I'm assuming you're using local autocompleter.

I just eyeballed the code for this. The exact matching in the code is
on line 436 of control.js.
Step one: read this method and understand exactly what it's doing
Step two: extend Autocompleter.Local, using code similar to this:

Autocompleter.LocalForeign = Class.create(Autocompleter.Local, {
   /* overriding functions here */

Step three: now override the setOptions method. Start by copy and
pasting it into your Autocompleter.LocalForeign or whatever you've
called it. Check that works as it did before.
Step four: modify the lines that find a position of a match so they
also consider the different accents/umlauts etc on each character.
This will need advanced regular expression matching I would guess. I
really don't have the time to invest in giving you a regular
expression pattern generator - but you'll have to write a function
that does that, it should go something like this:
1. Define array of arrays: within each nested array is a list of
"equivalent" characters: for instance one of the arrays will have e
and all the accented e's in, another arrray will have o and umlaut o
etc (as in your example)
2. For each character in the search string, see if it is in any of the
arrays. If it is, replace it with a regular expression or (just all
the characters in brackets)

Then try to match the regex in the same way that the autocompleter
currently works.

Ps. It's definitely worth noting that it's not prototype/
scriptaculous' fault that this isn't working as you'd like it to, as
your message seems to imply. The native behaviour for autocomplete
matching is exactly as it should be, in my opinion.

Pps. This is quite advanced stuff, there's no way around that that I
can think of (unless they're any geniuses out there willing to help!).
It may require you to read up (alot) on extending classes in
prototype, the specific source code of Autocompleter.Local, and of
course regular expressions.

On Sep 20, 6:26 am, Srini <[EMAIL PROTECTED]> wrote:
> Dear all,
> We need a solution how to handle special character issue in our
> application. We integrated a multiple selection id from the
> autocomplete (as like facebook autocomplete search) library (which
> developed in prototype).
> The following is our need,
> When we enter normal characters (a to z), it should match with the
> json data (from the preset data only the autocomplete search fetches
> the result) and display the results. The actual need is, when we enter
> 'koln'  in the textbox field the autocomplete should also fetch/match
> the 'köln'  from the data. But, it is not working now like that.
> Question is, when we enter an normal character -- whether there is any
> possibility to convert this character into all the other language
> characters and do the match. It means if i type 'o', than it should
> give us an 'o' like characters which is available in other languages
> (ex: ö - no matter the letter is german or russian)
> I would like to know, how does we can achieve this.
> Other infos,
> 1/. I tried with changing charset from ISO-8859-1 to UTF-8 in the
> server.
> 2/. I tried with changing charset from ISO-8859-1 to UTF-8(vice versa)
> in the autocomplete search page.. but no results yet.
> 3/. Also, I tried with changing charset from ISO-8859-1 to UTF-8 and
> other charsets types in the prototype.js too.
> Note:
> In facebook, they having this feature.
> Thanks,
> Srinivasan M
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to