git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug] git diff --word-diff gives wrong result for utf-8 chinese
@ 2022-11-29  3:46 Ping Yin
  2022-11-29  3:49 ` Ping Yin
  2022-11-29 10:52 ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 12+ messages in thread
From: Ping Yin @ 2022-11-29  3:46 UTC (permalink / raw)
  To: mailinggit list

[-- 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 --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-12-01 20:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29  3:46 [bug] git diff --word-diff gives wrong result for utf-8 chinese Ping Yin
2022-11-29  3:49 ` 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

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).