diff -r 805b9195c511 -r 4f072edc51a1 src/cm/utils/string_utils.py --- a/src/cm/utils/string_utils.py Sat Feb 13 11:54:11 2010 +0100 +++ b/src/cm/utils/string_utils.py Sat Feb 13 12:02:23 2010 +0100 @@ -1,4 +1,5 @@ import chardet +import re def to_unicode(input): if type(input) == str: @@ -12,4 +13,9 @@ if not res: raise Exception('UnicodeDecodeError: could not decode') return res - return input \ No newline at end of file + return input + +# strip carriage returns +def strip_cr(input): + return re.sub('\r\n|\r|\n', '\n', input) +