From: Kenichi Handa <handa@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 12291@debbugs.gnu.org, smithcu@gvsu.edu
Subject: bug#12291: [rev 109796] wrong UTF-8 handling
Date: Mon, 03 Sep 2012 09:59:22 +0900 [thread overview]
Message-ID: <87392zvs45.fsf@gnu.org> (raw)
In-Reply-To: <83bohrqr83.fsf@gnu.org> (message from Eli Zaretskii on Fri, 31 Aug 2012 13:40:44 +0300)
In article <83bohrqr83.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:
> > Date: Tue, 28 Aug 2012 21:22:26 +0200 (CEST)
> > From: Werner LEMBERG <wl@gnu.org>
> > Cc: 12291@debbugs.gnu.org, smithcu@gvsu.edu
> >
> > > I think the correct behaviour on reading such a file by utf-8 is to
> > > treat each byte as raw-byte.
> >
> > Maybe. I'm not sure how Emacs should behave in reading such files.
> We can either read them as raw bytes, or convert them to u+FFFD. The
> former sounds like a more useful behavior to me, FWIW.
What to convert to U+FFFD? Each byte, or the byte sequence?
Anyway, we can't simply convert them to U+FFFD because it
results in change of file contents just by reading and
writing. We can add post-read-conversion and
pre-write-conversion functions to the conding system utf-8
to perform the conversion (and adding text properties for
reverting) and reverting (using the text properties attached
at the time of reading). But, is it worth doing that?
I think converting each invalid byte to raw-byte is simpler
and equally useful.
---
Kenichi Handa
handa@gnu.org
next prev parent reply other threads:[~2012-09-03 0:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-28 5:47 bug#12291: [rev 109796] wrong UTF-8 handling Werner LEMBERG
2012-08-28 9:03 ` Andreas Schwab
2012-08-28 14:57 ` Kenichi Handa
2012-08-28 19:22 ` Werner LEMBERG
2012-08-31 10:40 ` Eli Zaretskii
2012-09-03 0:59 ` Kenichi Handa [this message]
2012-09-03 2:40 ` Eli Zaretskii
2022-01-27 16:32 ` Lars Ingebrigtsen
2022-01-27 16:52 ` Eli Zaretskii
2022-02-25 2:33 ` Lars Ingebrigtsen
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=87392zvs45.fsf@gnu.org \
--to=handa@gnu.org \
--cc=12291@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=smithcu@gvsu.edu \
/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.