summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2015-09-21 08:49:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-21 20:24:11 (GMT)
commit4cb870d8042bef3fdd953c633463eda24ce78f3d (patch)
tree02a98ef53eb6eef0004f26e7281995bf0d79cd9f /git-p4.py
parent00a9403a1069b19f27d690853db34459b32b3d3d (diff)
downloadgit-4cb870d8042bef3fdd953c633463eda24ce78f3d.zip
git-4cb870d8042bef3fdd953c633463eda24ce78f3d.tar.gz
git-4cb870d8042bef3fdd953c633463eda24ce78f3d.tar.bz2
git-p4: use replacement character for non UTF-8 characters in paths
If non UTF-8 characters are detected in paths then replace them with a placeholder instead of throwing a UnicodeDecodeError exception. This restores the original (implicit) implementation that was broken in 00a9403. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Reviewed-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-p4.py b/git-p4.py
index 65feb22..6030450 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2219,7 +2219,7 @@ class P4Sync(Command, P4UserMap):
encoding = 'utf8'
if gitConfig('git-p4.pathEncoding'):
encoding = gitConfig('git-p4.pathEncoding')
- relPath = relPath.decode(encoding).encode('utf8', 'replace')
+ relPath = relPath.decode(encoding, 'replace').encode('utf8', 'replace')
if self.verbose:
print 'Path with non-ASCII characters detected. Used %s to encode: %s ' % (encoding, relPath)