↓ Archives ↓

Category → webapps

Remove diacritics (Umlauts, Accents, Special characters) in JavaScript

So I recently found myself generating permalinks in JavaScript again which can be fun and painful. It seems to be less painful if you just ignore anything that’s not [a-zA-Z0-9] and replace it with a hyphen -.

However, this starts looking ugly rather quickly if you’re from Germany or France for instance, where use of umlauts and accents is very common. Something really nice like
J'ai montré les éléphants à ma sœur
becomes something really ugly like

So as Holger pointed out, I needed a diacritics table which I found here. After some modifications for the German language (e.g. ä -> ae, ß -> ss), I came up with this.

It’s still heavily based on what lehel built, so thank him, not me. I just wanted to put my improved version here, so I don’t forget it.

Update: I have created a Gist for this over at Github so we can continue to update it there…

Announcing listi.li

listi.li is a simple web app Jan and I programmed on a sunday afternoon.

listi.li let’s you create lists for you and your friends. Every list has it’s own unique link. Give the link to someone and ask them to create or vote for entries.

We use listi.li for virtually anything you need lists for: to remember things or to vote for the best alternative. E.g. share your opinion for the best VCS or the best green for playing Croquet with us. Private lists can be used for aggreeing on joint birthday presents or the place to go out tonight. I personally use listi.li to keep good ideas for christmas presents. If you have ideas how we could improve listi.li – please share them using the feedback button.

So go ahead and check it out 🙂