diff --git a/lib/core/common.py b/lib/core/common.py index 560232e23..0fe44bdf3 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -66,6 +66,7 @@ from lib.core.settings import SQLITE_ALIASES from lib.core.settings import ACCESS_ALIASES from lib.core.settings import FIREBIRD_ALIASES from lib.core.settings import DUMP_NEWLINE_MARKER +from lib.core.settings import DUMP_CR_MARKER from lib.core.settings import DUMP_DEL_MARKER from lib.core.settings import DUMP_TAB_MARKER from lib.core.settings import DUMP_START_MARKER @@ -577,7 +578,7 @@ def replaceNewlineTabs(inpStr, stdout=False): if stdout: replacedString = inpStr.replace("\n", " ").replace("\r", " ").replace("\t", " ") else: - replacedString = inpStr.replace("\n", DUMP_NEWLINE_MARKER).replace("\r", " ").replace("\t", DUMP_TAB_MARKER) + replacedString = inpStr.replace("\n", DUMP_NEWLINE_MARKER).replace("\r", DUMP_CR_MARKER).replace("\t", DUMP_TAB_MARKER) replacedString = replacedString.replace(kb.misc.delimiter, DUMP_DEL_MARKER) @@ -587,7 +588,7 @@ def restoreDumpMarkedChars(inpStr, onlyNewlineTab=False): replacedString = inpStr if isinstance(replacedString, basestring): - replacedString = replacedString.replace(DUMP_NEWLINE_MARKER, "\n").replace(DUMP_TAB_MARKER, "\t") + replacedString = replacedString.replace(DUMP_NEWLINE_MARKER, "\n").replace(DUMP_CR_MARKER, "\r").replace(DUMP_TAB_MARKER, "\t") if not onlyNewlineTab: replacedString = replacedString.replace(DUMP_START_MARKER, "").replace(DUMP_STOP_MARKER, "") diff --git a/lib/core/settings.py b/lib/core/settings.py index 96fdb7aed..164691a23 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -40,6 +40,7 @@ LOGGER.setLevel(logging.WARN) # dump markers DUMP_NEWLINE_MARKER = "__NEWLINE__" +DUMP_CR_MARKER = "__CARRIAGE_RETURN__" DUMP_DEL_MARKER = "__DEL__" DUMP_TAB_MARKER = "__TAB__" DUMP_START_MARKER = "__START__"