--- a/ztfy/utils/unicode.py Thu Aug 13 19:59:05 2009 +0200
+++ b/ztfy/utils/unicode.py Fri Aug 14 01:02:19 2009 +0200
@@ -82,7 +82,7 @@
_fillUnicodeTransTable()
-def translateString(s, escapeSlashes=False, forceLower=True) :
+def translateString(s, escapeSlashes=False, forceLower=True, spaces=' ') :
"""Remove extended characters from string and replace them with 'basic' ones
@param s: text to be cleaned.
@@ -103,6 +103,8 @@
s = ''.join([a for a in s.translate(_unicodeTransTable) if a.replace(' ','-') in (string.ascii_letters + string.digits + '_-.')])
if forceLower:
s = s.lower()
+ if spaces != ' ':
+ s = s.replace(' ', spaces)
return s