Skip to content
Commit a5923791 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

Projects plugin: fix git file listing for umlauts such as äöü

Summary:
git ls-files avoids umlauts or unicode surrogate characters.
The problem is that `git ls-files` outputs:

  $ git ls-files | grep Der
  "Der B\303\244cker/L\303\266ffler.txt"
  DerBaecker/Loeffler.txt

instead of "Der Bäcker\Löffler.txt".
It uses quotes and unicode escape sequences to avoid the ä and ö.

This patch uses `git ls-files -z` for listing the contents. Instead
of \r\n, the file listing the dumps a bytearray that is \0 separated
for each entry.

In the -z mode, no unicode escaping is done, and the umlauts such
as äöü or any other unicode characters are displayed correctly.

There is still room for improvement, since readAllStandardOutput()
might return a very large listing, which allocates a lot of memory.
Therefore, a buffered solution (using a lambda or so) would probably
be better. This, however, can be done in a separate patch.

BUG: 389415

Test Plan: make test

Reviewers: cullmann, gregormi, ngraham, brauch

Reviewed By: cullmann, brauch

Subscribers: brauch, #kate

Tags: #kate

Differential Revision: https://phabricator.kde.org/D10311
parent d0b0a948
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment