From: Paul Eggert <eggert@cs.ucla.edu>
To: Dmitry Gutov <dgutov@yandex.ru>, Eli Zaretskii <eliz@gnu.org>
Cc: oub@mat.ucm.es, 23595@debbugs.gnu.org
Subject: bug#23595: 25.1.50; file with chinese/japanse chars, vc-diff fails (HG, Git, RCS)
Date: Tue, 24 May 2016 23:19:05 -0700 [thread overview]
Message-ID: <574543D9.6080901@cs.ucla.edu> (raw)
In-Reply-To: <1f8cf525-c138-03f6-7f17-65015dc5cdfa@yandex.ru>
Dmitry Gutov wrote:
> Should `utf-8' altogether replace `undecided' in vc-coding-system-for-diff? Then
> the use of buffer-file-coding-system could be predicated on its being compatible
> with ascii.
That might be going too far.
We want buffer-file-coding-system to be compatible-enough with ASCII for the
case where diff output might contain ASCII metadata or non-ASCII file contents
or both. In this case, if buffer-file-coding-system is greatly incompatible with
ASCII, then ASCII will often be wrong (because the file data in the diff output
will be mostly UTF-16, say), and buffer-file-coding-system will often be wrong
too (because the non-file data will be mostly ASCII). So when
buffer-file-coding-system is greatly incompatible with ASCII, we can't use
either buffer-file-coding-system or UTF-8; they're both wrong too often.
The way it's *supposed* to work in a POSIX system, is that diff is supposed to
be applied to a file that is valid text according to the current locale's
encoding, and diff is supposed to generate both metadata and data that uses the
current locale's encoding. I expect that we should fall back on this approach
when buffer-file-coding-system is greatly incompatible with ASCII. This will
better handle unusual cases such as a system operating in an EBCDIC locale
(which can happen on IBM mainframes, though admittedly Emacs is not likely to
work well on such platforms). And this argues for sticking with 'undecided'
instead of 'utf-8' here.
(In theory it's possible for a GNU/Linux system to establish a locale with
UTF-16 encoding, so that diff's metadata and data are consistently UTF-16 for
this example. However, I've never heard of such a thing, and couldn't find any
evidence of one just now when I searched for it. So I don't think we need to
worry about this now.)
next prev parent reply other threads:[~2016-05-25 6:19 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-21 13:02 bug#23595: 25.1.50; file with chinese/japanse chars, vc-diff fails (HG, Git, RCS) Uwe Brauer
2016-05-23 11:52 ` Dmitry Gutov
2016-05-23 12:41 ` Uwe Brauer
2016-05-23 13:17 ` Dmitry Gutov
2016-05-23 16:52 ` Eli Zaretskii
2016-05-23 16:51 ` Eli Zaretskii
2016-05-23 16:48 ` Eli Zaretskii
2016-05-23 17:00 ` Uwe Brauer
2016-05-23 17:31 ` Eli Zaretskii
2016-05-23 20:37 ` Uwe Brauer
2016-05-23 21:01 ` Lars Ingebrigtsen
2016-05-24 2:33 ` Eli Zaretskii
2016-05-23 21:02 ` Dmitry Gutov
2016-05-23 22:16 ` Paul Eggert
2016-05-23 22:28 ` Dmitry Gutov
2016-05-24 0:07 ` Paul Eggert
2016-05-24 9:47 ` Dmitry Gutov
2016-05-25 6:51 ` Paul Eggert
2016-05-25 12:44 ` Dmitry Gutov
2016-05-25 12:48 ` Overriding the value of indent-tabs-mode in Emacs code Dmitry Gutov
2016-05-25 21:44 ` Paul Eggert
2016-05-25 22:00 ` Dmitry Gutov
2016-05-25 22:11 ` Paul Eggert
2016-05-25 22:18 ` Dmitry Gutov
2016-05-25 22:36 ` Paul Eggert
2016-05-25 22:47 ` Dmitry Gutov
2016-05-25 23:24 ` Michael Heerdegen
2016-05-25 23:30 ` Dmitry Gutov
2016-05-25 23:54 ` Stefan Monnier
2016-05-26 10:59 ` Dmitry Gutov
2016-05-26 12:18 ` Stefan Monnier
2016-05-27 19:45 ` John Wiegley
2016-05-27 19:50 ` Stefan Monnier
2016-05-27 20:19 ` Paul Eggert
2016-05-27 20:53 ` John Wiegley
2016-05-26 0:00 ` Michael Heerdegen
2016-05-25 23:40 ` Karl Fogel
2016-05-26 0:02 ` Michael Heerdegen
2016-05-24 2:40 ` bug#23595: 25.1.50; file with chinese/japanse chars, vc-diff fails (HG, Git, RCS) Eli Zaretskii
2016-05-24 15:36 ` Eli Zaretskii
2016-05-24 2:36 ` Eli Zaretskii
2016-05-24 9:35 ` Dmitry Gutov
2016-05-24 15:40 ` Eli Zaretskii
2016-05-25 0:09 ` Dmitry Gutov
2016-05-25 16:22 ` Eli Zaretskii
2016-05-25 23:21 ` Dmitry Gutov
2016-05-26 10:44 ` Uwe Brauer
2016-05-26 15:35 ` Eli Zaretskii
2016-06-19 19:09 ` Dmitry Gutov
2016-05-25 6:19 ` Paul Eggert [this message]
2016-05-25 16:27 ` Eli Zaretskii
2016-05-25 6:19 ` Paul Eggert
2016-05-25 16:26 ` Eli Zaretskii
2016-05-23 17:40 ` Paul Eggert
2016-05-23 18:15 ` Eli Zaretskii
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=574543D9.6080901@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=23595@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=eliz@gnu.org \
--cc=oub@mat.ucm.es \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.