| changeset 175 | 4f072edc51a1 |
| parent 149 | 0f2c5744b39b |
| child 236 | 725653080973 |
--- 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) +