diff options
Diffstat (limited to 'hercules/code')
-rw-r--r-- | hercules/code/stringutils.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/hercules/code/stringutils.py b/hercules/code/stringutils.py index 9dcbff8..0bcfaa7 100644 --- a/hercules/code/stringutils.py +++ b/hercules/code/stringutils.py @@ -30,8 +30,19 @@ def strToXml(data): def stripNewLine(data): if len(data) == 0: return data - if data[-1] == "\n": + if data[-1] == "\r": data = data[:-1] + if len(data) > 0 and data[-1] == "\n": + data = data[:-1] + return data + +def stripWindows(data): + if len(data) == 0: + return data + if data[-1] == "\r": + data = data[:-1] + if len(data) > 1 and data[-2] == "\r": + data = data[:-2] + data[-1] return data def escapeSqlStr(data): |