Date: Fri, 24 May 2013 08:59:46 +0200
Quote:
- Daily Python-URL! (from the Secret Labs)
Unicode and permalinks
http://www.pythonware.com/daily/#entry1101655558852691533
Text:
Eli Golovinsky:
Unicode and permalinks
["The idea of a permalink is to take the title (of a blog post or a test) and replace any characters that aren't numbers or letters with an underscore or a hyphen. Using this simple scheme, 'Unicode and permalinks' becomes 'unicode-and-permalinks', which is quite suitable for use in a URL. The implementation is a simple regular expression /.../ While this code works perfectly for the English language, it doesn’t work at all if string is a Unicode string containing something in Hebrew, Russian or Polish - language that some of our customers use. And so, I set out to write code that will essentially behave like the regular expression above, but will work for letters and numbers in all the languages of the world."]
Via FeedShow.com