pythonware.com products ::: library ::: search ::: daily Python-URL!
A Django site.
   

Unicode and permalinks ::: Daily Python-URL

2008-09-22

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."]

::: back to daily-URL