From: larsxschneider@gmail.com
To: git@vger.kernel.org
Cc: luke@diamand.org, Lars Schneider <larsxschneider@gmail.com>
Subject: [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths
Date: Mon, 21 Sep 2015 10:49:18 +0200 [thread overview]
Message-ID: <1442825358-90294-2-git-send-email-larsxschneider@gmail.com> (raw)
In-Reply-To: <1442825358-90294-1-git-send-email-larsxschneider@gmail.com>
From: Lars Schneider <larsxschneider@gmail.com>
If non UTF-8 characters are detected in paths then replace them with �
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>
---
git-p4.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index e7510a9..215f556 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2226,7 +2226,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)
--
2.5.1
next prev parent reply other threads:[~2015-09-21 8:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 8:49 [PATCH v3] git-p4: use replacement character for non UTF-8 characters in paths larsxschneider
2015-09-21 8:49 ` larsxschneider [this message]
2015-09-21 19:34 ` Luke Diamand
2015-09-21 20:23 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442825358-90294-2-git-send-email-larsxschneider@gmail.com \
--to=larsxschneider@gmail.com \
--cc=git@vger.kernel.org \
--cc=luke@diamand.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).