Don't know if this is really a feature request...
If the title, taxonomy or taxonomy terms include a special character, such as æ, ø, å, pathauto should translate into ae, oe, or aa, or a o or a. As is, urls with these characters are created, and it seems to break the url. This is propably also the case for characters that would normally not belong in an url, ä, ö, ü and so on.
Comments
Comment #1
hrkaspar commentedThis will of course relate to http://drupal.org/node/19939 - filed as feature request. But beware that the problem also exists for non-accented characters.
Comment #2
mikeryanYep - as with the other issue, I'm open to suggestions from those with more experience with character set issues. I'm hoping there's a simple function call somewhere, I don't want to resort to my own table of character mappings...
Comment #3
Steven commentedDon't map them at all. Browsers with IRI (internationalized resource identifiers) support can handle Unicode characters in URLs. The UTF-8 bytes are escaped with %XX syntax. Search engines understand this.
For example:
http://localhost/日本語
http://localhost/Français
http://localhost/Fran%C3%A7ais
Check the status bar when hovering over these links. See where you are directed when you click them. The only place where it looks ugly is in the browser addressbar, and even then there is work to fix that. Mozilla has IRI support already, but I believe it is off by default.
Comment #4
mikeryanYes, but...
removes those characters entirely. How can I preserve them?
Does IE have IRI support? If IE doesn't support it, and Mozilla has it off by default, then 95% of people browsing the web can't use it today...
I'm open to either a solution that preserves these characters within the URL, or replaces them with ASCII equivalents, as an improvement on the current state where they simply get removed - I'm still looking for a suggestion on how to do that. It's probably obvious to those who deal with multi-lingual issues on the Internet regularly, but I'm a red-blookded true-blue American.
[Obligatory joke:
What do you call someone who speaks two languages?
Bilingual.
What do you call someone who speaks three languages?
Trilingual.
What do you call someone who speaks one language?
American.
]
Comment #5
jdmquin commentedThe following code replaces accented characters with their ASCII counterparts. This is from a patch submitted earlier by elonen at http://drupal.org/node/18691. The patch adds the ability to add php scripts for path aliases which may be a little much for some drupal administrators, but it has several other good enhancements including this one.
Here is the code from that patch:
I would still prefer to leave the accents but this is a good workaround till someone figures it out.
Thanks
JJ
Comment #6
mikeryanI've committed a fix using an example found in the PHP manual's strtr comments, which handles the ligatures hrkaspar was concerned with as well as stripping accents.
Whether leaving accents in the URL is desirable or not, even if pathauto passes them to path_set_alias() they will fail, Drupal's valid_url() function will not permit them.
Comment #7
mikeryan