help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: about xhtml-mode encoding problem


From: address@hidden
Subject: Re: about xhtml-mode encoding problem
Date: Wed, 11 Jul 2007 23:02:22 +0900
User-agent: Thunderbird 1.5.0.12 (X11/20070604)

Lennart Borgman (gmail) wrote:
呂 克 wrote:
Sorry I had a mistake.
The problem is on  *nxhtml-mode*,not xhtml-mode.

I added these line in my .emacs.
load-file (concat plugin_path "/nxml/autostart.el"))
(setq auto-mode-alist (cons '("\\.jsp$" . nxhtml-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.asp$" . nxhtml-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.php$" . nxhtml-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.phtml$" . nxhtml-mode) auto-mode-alist))

(modify-coding-system-alist 'file "\\.jsp\\'" 'sjis)
(add-to-list 'file-coding-system-alist '("\\.jsp\\'" . sjis))
(add-to-list 'file-coding-system-alist '("\\.xhtml\\'" . sjis))
(prefer-coding-system 'sjis)

But I'm sorry to say all of them doesn't work.
when I save the file it become utf-8.
I'm using emacs 22 on linux and windows xp.


Thanks, that was why I asked you which major modes you are using.

nxhtml-mode is derived from nxml-mode and I think it handles coding systems a bit differently. Look at write-contents-functions in the buffer. I think it contains nxml-prepare-to-save. That function tries to get the coding system to use from the XML header if the coding system has not been specified explicitly for the buffer through buffer-file-coding-system.

Is there an XML header in the buffer in your case? What coding system does it specify?


_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs


I'm Sorry to reply late.
Is there an XML header in the buffer in your case? What coding system does it specify?
I don't know what's the meaning.
There is a xml menu.but I don't  know What coding system does it specify?
Please see the attachment.
the first's file coding system is shift-jis(this is a s: at the left bottom)
but when I use C-x C-s,it because u: (utf)
I don't know why.





PNG image

PNG image


reply via email to

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