From: Ping Yin <pkufranky@gmail.com>
To: mailinggit list <git@vger.kernel.org>
Subject: [bug] git diff --word-diff gives wrong result for utf-8 chinese
Date: Tue, 29 Nov 2022 11:46:43 +0800 [thread overview]
Message-ID: <CACSwcnQfTOYHxSJQqc+viiqkCqt=WZieuCw70PqOdvo88XdeOQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
Result of "git diff"
- 为1
+ 为2
or (if chinese can not be displayed correctly)
- <E4><B8><BA>1
+ <E4><B8><BA>2
Actual result of "git diff --color-words"
<E4><B8>[-<BA>1-]{+<BA>2+}
Expected result of "git diff --color-words"
为[-1-]{+2+}
or (if chinese can not be displayed correctly)
<E4><B8><BA>[-1-]{+2+}
Ping Yin
[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 5682 bytes --]
[-- Attachment #3: image.png --]
[-- Type: image/png, Size: 9992 bytes --]
next reply other threads:[~2022-11-29 3:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 3:46 Ping Yin [this message]
2022-11-29 3:49 ` [bug] git diff --word-diff gives wrong result for utf-8 chinese Ping Yin
2022-11-29 8:18 ` Bagas Sanjaya
2022-11-29 10:52 ` Ævar Arnfjörð Bjarmason
2022-11-29 11:32 ` Junio C Hamano
2022-11-29 18:23 ` Jeff King
2022-11-29 18:54 ` Jeff King
2022-12-01 7:08 ` Ping Yin
2022-12-01 7:33 ` Ping Yin
2022-12-01 14:51 ` Phillip Wood
2022-12-01 15:51 ` Ping Yin
2022-12-01 20:06 ` Jeff King
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='CACSwcnQfTOYHxSJQqc+viiqkCqt=WZieuCw70PqOdvo88XdeOQ@mail.gmail.com' \
--to=pkufranky@gmail.com \
--cc=git@vger.kernel.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).