Ticket #2391: titlecase.diff

File titlecase.diff, 524 bytes (added by rob, 18 years ago)
  • defaultfilters.py

     
    8484
    8585def title(value):
    8686    "Converts a string into titlecase"
    87     return re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title())
     87    #~ return re.sub("(?u)([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title())
     88    return value.decode('utf8').title().encode('utf8')
    8889
    8990def truncatewords(value, arg):
    9091    """
Back to Top