Ticket #10254: unicodefn.diff

File unicodefn.diff, 505 bytes (added by Karen Tracey, 16 years ago)
  • django/utils/text.py

     
    122122    u'johns_portrait_in_2004.jpg'
    123123    """
    124124    s = force_unicode(s).strip().replace(' ', '_')
    125     return re.sub(r'[^-A-Za-z0-9_.]', '', s)
     125    return re.sub(r'(?u)[^-\w.]', '', s)
    126126get_valid_filename = allow_lazy(get_valid_filename, unicode)
    127127
    128128def get_text_list(list_, last_word=ugettext_lazy(u'or')):
Back to Top