unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: cannot encode a buffer??
Date: Wed, 25 Jun 2003 16:52:34 +0900 (JST)	[thread overview]
Message-ID: <200306250752.QAA01036@etlken.m17n.org> (raw)
In-Reply-To: <ur85j5lpg.fsf@gnu.org> (message from Sam Steingold on 24 Jun 2003 15:17:47 -0400)

In article <ur85j5lpg.fsf@gnu.org>, Sam Steingold <sds@gnu.org> writes:
>>  > I have a file which starts with
>>  > ";;; -*- coding: utf-8-unix -*-"
>>  >
>>  > when I try to save it, I get this:
>>  >
>>  > These default coding systems were tried to encode text
>>  > in the buffer `.bbdb':
>>  >   utf-8-unix
>>  > However, each of them encountered these problematic characters:
>>  >   utf-8-unix: 山 本 和 彦
>>  
>>  Does it work after (utf-translate-cjk-mode 1)?

> indeed it does.  thanks.

> I wonder what is going on here: why did Emacs insist on asking me about
> the new coding system on every save and then gleefully accepted the
> coding system in the file header?

It seems that when Emacs at first read the file .bbdb, those
Japanese characters didn't exist, but they were inserted in
the buffer by yourself or automatically by some package in
your Emacs session.  Correct?

If utf-translate-cjk-mode is not turned on, those characters
can't be encoded by utf-8.  If you force saving them by
utf-8, the encoder generates a utf-8 byte sequence
corresponding to U+FFFD for each of them.  In this
situation, when you modify the buffer and try to save it,
Emacs again detects that those characters can't be handled
by utf-8, thus ask you to select some other safe coding
system.  There's no mechanism to distinguish once saved
characters from the newly inserted characters.

---
Ken'ichi HANDA
handa@m17n.org

  parent reply	other threads:[~2003-06-25  7:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-24 14:52 cannot encode a buffer?? Sam Steingold
2003-06-24 16:23 ` Kai Großjohann
2003-06-24 19:17   ` Sam Steingold
2003-06-25  7:03     ` Kai Großjohann
2003-06-25  7:52     ` Kenichi Handa [this message]
2003-06-25 11:22       ` Stephen J. Turnbull
2003-06-25 11:52         ` Jason Rumney

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200306250752.QAA01036@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).