From 928cedba1ced25e9b8f12f20c5725b19e38ee694 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 23 Jul 2003 13:37:00 +0000 Subject: [PATCH] Cope slightly better with binary data. git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/Edit@2903 66de3db3-b00d-0410-b41b-f4738ad19bea --- EditWindow.py | 6 +++++- Help/Changes | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/EditWindow.py b/EditWindow.py index 405f758..b485b53 100644 --- a/EditWindow.py +++ b/EditWindow.py @@ -361,7 +361,11 @@ class EditWindow(g.Window, XDSLoader, Saveable): decoder = codecs.getdecoder(encoding) try: data = decoder(data, errors)[0] - assert '\0' not in data + if errors == 'strict': + assert '\0' not in data + else: + if '\0' in data: + data = data.replace('\0', '\\0') break except: pass diff --git a/Help/Changes b/Help/Changes index f88f2da..d66170b 100644 --- a/Help/Changes +++ b/Help/Changes @@ -8,6 +8,7 @@ Dnd loading: Loads to cursor, not indicated point. ~~~~~~~~~~~ Group actions for undo and redo. Removed Process minibuffer. +Cope slightly better with binary data. 22-Jul-2003 ~~~~~~~~~~~ -- 2.11.4.GIT