aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2013-05-09 00:45:27 +0200
committerTorgny Nyblom <nyblom@kde.org>2013-05-17 18:49:48 +0200
commit4a1e11c6ceb17b764c613778d8ce408f0aa28a48 (patch)
tree455cb6bada50d42d5b7736ade1bd05ade71cdf73
parentb5c3d3aa55621c44db439e4a73884e0d0bf9612c (diff)
downloadsvn2git-4a1e11c6ceb17b764c613778d8ce408f0aa28a48.tar
svn2git-4a1e11c6ceb17b764c613778d8ce408f0aa28a48.tar.gz
svn2git-4a1e11c6ceb17b764c613778d8ce408f0aa28a48.tar.bz2
svn2git-4a1e11c6ceb17b764c613778d8ce408f0aa28a48.tar.xz
svn2git-4a1e11c6ceb17b764c613778d8ce408f0aa28a48.zip
Stop unintended re-encoding of author names from UTF-8 to ASCII
To see the bug in action, use an author map with umlauts, e.g. nickname = Hällo Wörld from UTF-8 <mail@example.org> and check "git log" after the conversion. What is happening? QByteArray "author" is first decoded as UTF-8 into a QString. That QString is passed to QByteArray::append(const QString &) which internally encodes the QString to ASCII byte data using QString::toAscii(). "git fast-import" expects UTF-8 input from us, so the original QByteArray with UTF-8 content is just what we need.
-rw-r--r--src/repository.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
index 779dd28..3dd84af 100644
--- a/src/repository.cpp
+++ b/src/repository.cpp
@@ -736,7 +736,7 @@ void Repository::Transaction::commit()
QByteArray s("");
s.append("commit " + branchRef + "\n");
s.append("mark :" + QByteArray::number(mark) + "\n");
- s.append("committer " + QString::fromUtf8(author) + " " + QString::number(datetime) + " +0000" + "\n");
+ s.append("committer " + author + " " + QString::number(datetime).toUtf8() + " +0000" + "\n");
s.append("data " + QString::number(message.length()) + "\n");
s.append(message + "\n");
repository->fastImport.write(s);