4

am using jquery tablesorter plugin and in my "country" column i got special characters like this: Índia.

The fact is that when i hit the header of the column to sort it, it puts my "Índia" at the end of the column. I guess the nav sees the Í instead of the real "I" with an accent.

Any clue on how to make it work even with accents ?

Here's the js code in my domready:

$.tablesorter.defaults.widgets = ['zebra'];
$.tablesorter.defaults.sortList = [[0,0]];
$("table").tablesorter();

Thanks in advance.

kevin
  • 618
  • 8
  • 24
  • Have you taken a look at A List Apart's article on accent folding? They suggest using an array to map certain accented characters to their associated non-accent characters in order to help with the example's auto-complete feature. Here's a link: http://www.alistapart.com/articles/accent-folding-for-auto-complete/ I hope this helps point you in the right direction. I'll take a closer look at that plugins code and let you know if I find anything. – Levi Hackwith Mar 10 '10 at 18:08
  • Thanks for the link, i gave a look but i have to admit it doesnt help me much. Am not a jquery dev so i'm a bit lost... – kevin Mar 11 '10 at 18:34
  • With the special characters in your data, can they be safely removed from the data and replaced with a normal character? Or do you need to keep the accents and such intact? – Levi Hackwith Mar 11 '10 at 20:29
  • Yeah i could but it's a spelling mistake. So i'd like to keep the accent. – kevin Mar 16 '10 at 20:04

1 Answers1

4

This person had the same problem you did. Check this question out: Efficiently replace all accented characters in a string?

Community
  • 1
  • 1
Levi Hackwith
  • 9,232
  • 18
  • 64
  • 115
  • Thanks for the link Levi, it's that. The only thing is that it doesnt work. I already double checked but cant see where the pb is. – kevin Mar 16 '10 at 21:29
  • If someone's having the some trouble, just follow the link Levi gave and read my chat with Tomalak at the bottom of the page, works for me now. – kevin Mar 18 '10 at 20:59
  • @Levi Thanks for cross-linking! Appreciated. :) – Tomalak Mar 18 '10 at 21:33