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: Lennart Borgman (gmail)
Subject: Re: about xhtml-mode encoding problem
Date: Mon, 09 Jul 2007 19:59:31 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070604 Thunderbird/2.0.0.4 Mnenhy/0.7.5.666

呂 克 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?




reply via email to

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