擅长:python、mysql、java
<p>有一些utf-8字符的角盒</p>
<p>示例:</p>
<pre><code>>>> from django.template.defaultfilters import slugify
>>> slugify(u"test ąęśćółń")
u'test-aescon' # there is no "l"
</code></pre>
<p>这可以用<a href="http://pypi.python.org/pypi/Unidecode/0.04.9" rel="noreferrer">Unidecode</a>来解决</p>
<pre><code>>>> from unidecode import unidecode
>>> from django.template.defaultfilters import slugify
>>> slugify(unidecode(u"test ąęśćółń"))
u'test-aescoln'
</code></pre>