emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cannot encode a buffer??


From: Kenichi Handa
Subject: Re: cannot encode a buffer??
Date: Wed, 25 Jun 2003 16:52:34 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Sam Steingold <address@hidden> 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
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]