Ticket #2391: titlecase.diff
File titlecase.diff, 524 bytes (added by , 18 years ago) |
---|
-
defaultfilters.py
84 84 85 85 def title(value): 86 86 "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') 88 89 89 90 def truncatewords(value, arg): 90 91 """