Ticket #2276: defaultfilters.py.diff

File defaultfilters.py.diff, 600 bytes (added by nkeric, 18 years ago)
  • django/template/defaultfilters.py

     
    6565
    6666def slugify(value):
    6767    "Converts to lowercase, removes non-alpha chars and converts spaces to hyphens"
    68     value = re.sub('[^\w\s-]', '', value).strip().lower()
     68    value = unicode(value, 'utf-8')
     69    p = re.compile('[^\w\s-]', re.U)
     70    value = re.sub(p, '', value).strip().lower()
    6971    return re.sub('[-\s]+', '-', value)
    7072
    7173def stringformat(value, arg):
Back to Top