all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xml encoding conflict with my defult emacs language configuartion
@ 2004-02-23  5:41 niDapeng
  2004-02-23  6:35 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: niDapeng @ 2004-02-23  5:41 UTC (permalink / raw)


I set my emacs environment as Chinese(GB2312), which is my common use. 
When I edit XML by UTF-8, I input some Chinese words( GB2312 encoding). When I try to save, emacs prompt there is conflict between them.Message as following:
======================================================
Selected encoding chinese-iso-8bit-dos disagrees with utf-8 specified by file contents.  Really save (else edit coding cookies and try again)? (yes or no) 
======================================================


I try to use "C-x RET-c UTF-8 C-x C-s" to save text, it prompt some message and also save some corrupt characters, and message as following:
=================================================
These default coding systems were tried to encode text
in the buffer `a.xml':
  utf-8
However, each of them encountered these problematic characters:
  utf-8: ÖÐ ÎÄ
The first problematic character is at point in the displayed buffer,
and C-u C-x = will give information about it.

Select one of the following safe coding systems, or edit the buffer:
  gb2312 hz-gb-2312 iso-2022-7bit
Or specify any other coding system
at the risk of losing the problematic characters.
=================================================


I guess so: because my buffer text is GB2312 ( my input method only accept GB2312). Emacs can't convert GB2312 to UTF-8 automatically, it only enforce GB2312 to UTF-8.

Is there a easy way to approach my reqired? I need: firstly, it can save GB2312 to UTF-8 correctly, secondly, it's better there aren't so many message to let me confirm, "silent save" is better.


----------------------------------------------
ÍæÓÎÏ·Ó®ÊýÂëÏà»ú¡¢MP3¡¢UÅÌ 
http://mail.21cn.com/huodong/0310/ 
ÖÐÃÀÈÕº«¸ßÖÐÉúÐÔµ÷²é:ÈÕÅ®ÉúÐÔ¹ÛÄî×·Å 
http://news.21cn.com/huahua/ 
¹ã¶«ADSLÓû§ÓÐ×ÅÊý£¬21CNÉÌÎñÓÊÃâ·ÑÁì 
http://mail.21cn.com/vip 
Ï£À°Ç°×ÜÀíÓëÃÀÑÞ¿Õ½ãÄÖ³öÌÒÉ«ÐÔ³óÎÅ(ͼ) 
http://news.21cn.com/social/ 

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

* Re: xml encoding conflict with my defult emacs language configuartion
  2004-02-23  5:41 xml encoding conflict with my defult emacs language configuartion niDapeng
@ 2004-02-23  6:35 ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2004-02-23  6:35 UTC (permalink / raw)


> Date: Mon, 23 Feb 2004 13:41:08 +0800 (CST)
> From: "niDapeng"<steveneo@21cn.com>
> 
> I set my emacs environment as Chinese(GB2312), which is my common use. 

Please make sure you also set up your mailer to generate correct
Charset headers.  Your message said:

> Content-Type: text/plain
> MIME-Version: 1.0

which is blatantly wrong, as I think it was encoded in gb2312, not in
US-ASCII.

> When I edit XML by UTF-8, I input some Chinese words( GB2312 encoding). When I try to save, emacs prompt there is conflict between them.Message as following:
> ======================================================
> Selected encoding chinese-iso-8bit-dos disagrees with utf-8 specified by file contents.  Really save (else edit coding cookies and try again)? (yes or no) 
> ======================================================

What version of Emacs is that?  (If it's the CVS version, please send
such reports to emacs-pretest-bug@gnu.org, not here.)

I think this happens because your Emacs doesn't support Chinese
characters in the Unicode charsets.  I don't remember the details,
but Emacs in CVS might have a way to convert gb2312 to Unicode; I
suggest asking on emacs-pretest-bug@gnu.org or emacs-devel@gnu.org.

> Is there a easy way to approach my reqired? I need: firstly, it can save GB2312 to UTF-8 correctly, secondly, it's better there aren't so many message to let me confirm, "silent save" is better.

Emacs doesn't keep silent when there's a real danger of corrupting
your files.  I think this is a correct policy when there's no way for
Emacs to silently do the right thing.

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

* Re: xml encoding conflict with my defult emacs language configuartion
@ 2004-02-24  6:16 niDapeng
  2004-02-24  6:53 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: niDapeng @ 2004-02-24  6:16 UTC (permalink / raw)
  Cc: help-gnu-emacs

I guess my English isn't good enough to explain my question exactly.
My emacs is Windows version 21.3.1. And you needn't try to guess my emacs setting from my email encoding, becuase I didn't use Emacs as my email client:)
My .emacs has such settting:
============================================
(set-language-environment 'Chinese-GB)
(set-clipboard-coding-system 'chinese-iso-8bit) ;euc-cn
(set-terminal-coding-system 'chinese-iso-8bit)
(set-buffer-file-coding-system 'chinese-iso-8bit)
(set-selection-coding-system 'chinese-iso-8bit)
(set-keyboard-coding-system 'chinese-iso-8bit)
(setq-default pathname-coding-system 'chinese-iso-8bit)

(modify-coding-system-alist 'process "*" 'chinese-iso-8bit)
(setq default-process-coding-system '(chinese-iso-8bit . chinese-iso-8bit))
====================================================

I use XAE to create a docbook XML file, and input Chinese words. When I save, message pop up like my last mail. I guess the reason is : my buffer file is GB2312 encoding, but emacs try to save it as UTF-8, and emacs can't convert GB2312 Chinese words to UTF-8 automatically. So emacs ask if I want to save forcedly .

BTW, my another mail, about "Redo" function. My mean is when I do more "undo", I can't use "redo" function to "undo" last time "undo":). I do think it's common request for an editor. but why emacs hasn't accept "redo" as default command.

Thanks your kindly reply!
Best

----------------------------------------------
ÍæÓÎÏ·Ó®ÊýÂëÏà»ú¡¢MP3¡¢UÅÌ 
http://mail.21cn.com/huodong/0310/ 
ÖÐÃÀÈÕº«¸ßÖÐÉúÐÔµ÷²é:ÈÕÅ®ÉúÐÔ¹ÛÄî×·Å 
http://news.21cn.com/huahua/ 
¹ã¶«ADSLÓû§ÓÐ×ÅÊý£¬21CNÉÌÎñÓÊÃâ·ÑÁì 
http://mail.21cn.com/vip 
Ï£À°Ç°×ÜÀíÓëÃÀÑÞ¿Õ½ãÄÖ³öÌÒÉ«ÐÔ³óÎÅ(ͼ) 
http://news.21cn.com/social/ 

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

* Re: xml encoding conflict with my defult emacs language configuartion
  2004-02-24  6:16 niDapeng
@ 2004-02-24  6:53 ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2004-02-24  6:53 UTC (permalink / raw)


> Date: Tue, 24 Feb 2004 14:16:07 +0800 (CST)
> From: "niDapeng"<steveneo@21cn.com>
> 
> I guess my English isn't good enough to explain my question exactly.

I think I understood it, your English is fine.

> My emacs is Windows version 21.3.1.

If I'm not mistaken, that version of Emacs indeed does not support
Chinese characters in the Unicode character set.

> And you needn't try to guess my emacs setting from my email encoding, becuase I didn't use Emacs as my email client:)

I didn't say to fix the mail in Emacs, I said to fix your mailer
(which I saw in the headers to be something called "AIMC 2.9.5.6
2002.10.10").  The fact that you use a mailer other than Emacs
doesn't mean you shouldn't set it up correctly.

This is especially true when posting messages about non-ASCII
characters: how can you expect me to understand the problem if the
Chinese characters you are writing about appear as random garbage on
my screen?  Thanks Emacs saints that we have "M-x rmail-redecode-body",
or else I'd be lost.

> I use XAE to create a docbook XML file, and input Chinese words. When I save, message pop up like my last mail. I guess the reason is : my buffer file is GB2312 encoding, but emacs try to save it as UTF-8, and emacs can't convert GB2312 Chinese words to UTF-8 automatically. So emacs ask if I want to save forcedly .

That's true, for your version of Emacs.  What would you like Emacs to
do instead?

> BTW, my another mail, about "Redo" function. My mean is when I do more "undo", I can't use "redo" function to "undo" last time "undo":). I do think it's common request for an editor. but why emacs hasn't accept "redo" as default command.

You can "undo" the "undo".  For that, after you invoke the "undo"
command, press some key that doesn't change the buffer (I usually
press the Right key) and then invoke "undo" again.  It will now redo
the last change you undid.

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

end of thread, other threads:[~2004-02-24  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-23  5:41 xml encoding conflict with my defult emacs language configuartion niDapeng
2004-02-23  6:35 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2004-02-24  6:16 niDapeng
2004-02-24  6:53 ` Eli Zaretskii

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.