“Hello; this is a batched-reply I'm giving to the e-mails I received about transliteration; I'm really most pleasantly surprised to have received so many so quickly, it's obviously a passionate subject for some. I care that my code does a good job as it already improves greatly on the single-function examples I've trawled through and discarded for years. Despite the fact that I don't have any experience of other languages and scripts, so I do not proclaim accuracy but I do proclaim that I tried harder than all the other functions I've seen thus far (excluding the full blown million-line long libraries :P). I'm open to all input on the subject.
:: Issue #1
The first thing you raised was German umlauts. "ä->ae, ö->oe, ü->ue" &c. Others added that this is not the case in Sweden.
:: Issue #2
"ñ" to either "ni" or "nn"; I always thought it should be "ny" (e.g. "Mañana" > "Manyana") -- can anybody else help confirm what it should be?
In answering these it's important to note that the function is specifically for filenames and URLs; not for body text. Perfection is inherently impossible because of differences in locales (such as Issue #2), and therefore we must simply weigh up the gains and the losses.
In that regard I am inclined to support converting umlauts in the way requested by multiple people ("ä->ae, ö->oe, ü->ue"), despite the fact that this goes against Swedish practices. It's only for URLs and filenames and so plays a tiny part, and I think it's the best option rather than the other way around.
---
RE: The licence. One person mentioned that there was no licence on the gist. The code is creative-commons 3. You may do anything you please so long as you give credit -- but to be honest I will not hunt you down if you don't credit. I licence with cc-by3 solely to preserve copyright so that someone can't come along and claim the code was their own invention and sue me for it or something. I'm completely lax when it comes to licences, just follow Wheaton's law. Credit only has to be a comment line to go along with the function, credit is not required outside the source code, and it can be used in close-source. You can re-licence, as long as credit is retained in the code.
Kind regards,
Kroc Camen.”