JavaScript Editor Ajax software     Free javascripts 



Main Page

Figure 12-1
It may also be possible to use the unaccented characters in a misspelling in a heading, because that is nor-
matively acceptable in some languages. The following function normalizes accented characters in Western
European languages to their non-accented equivalents. It can be applied anywhere in code, including to
URL functions and code at the presentation level. You will apply it in the example e-commerce store for
URLs, both to make them more aesthetically pleasing, as well as to optimize for non-accent misspellings.
Following is a function that replaces accented characters with their non-accented equivalents. This func-
tion was originally found on
http://us3.php.net/strtr
:
function normalizeExtendedCharacters($str)
{
return strtr($str,
“\xe1\xc1\xe0\xc0\xe2\xc2\xe4\xc4\xe3\xc3\xe5\xc5”.
“\xaa\xe7\xc7\xe9\xc9\xe8\xc8\xea\xca\xeb\xcb\xed”.
“\xcd\xec\xcc\xee\xce\xef\xcf\xf1\xd1\xf3\xd3\xf2”.
“\xd2\xf4\xd4\xf6\xd6\xf5\xd5\x8\xd8\xba\xf0\xfa”.
“\xda\xf9\xd9\xfb\xdb\xfc\xdc\xfd\xdd\xff\xe6\xc6\xdf”,
“aAaAaAaAaAaAacCeEeEeEeEiIiIiIiInNoOoOoOoOoOoOoouUuUuUuUyYyaAs”);
}
246
Chapter 12: Foreign Language SEO
c12.qxd:c12 10:45 246


JavaScript Editor Ajax software     Free javascripts