[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cyrillic vs UTF-8
From: |
Stefan Monnier |
Subject: |
Re: Cyrillic vs UTF-8 |
Date: |
Mon, 19 May 2003 09:28:56 -0400 |
> > Maybe it is. In my situation, I'd like utf-8 to be at the top
> > of the preferences w.r.t decoding because it virtually never
> > guesses wrong.
> > OTOH, I'm still using a mostly-latin-1 environment, so I'd
> > still rather avoid utf-8 when I can. I.e. latin-1 should be at
> > the top of my preferences w.r.t encoding.
>
> In that case, I think the source of the problem is that the
> command prefer-coding-system doesn't satisfy this request of
> yours:
> Prefer utf-8 only in automatic detection on reading a
> file, not for the other situations.
>
> (defun prefer-coding-system (coding-system)
> "Add CODING-SYSTEM at the front of the priority list for automatic
> detection.
> This also sets the following coding systems:
> o coding system of a newly created buffer
> o default coding system for subprocess I/O
> This also sets the following values:
> o default value used as `file-name-coding-system' for converting file names.
> o default value for the command `set-terminal-coding-system' (not on MSDOS)
> o default value for the command `set-keyboard-coding-system'
>
> How about changing it to skip "This also ..." parts if
> called with a prefix argument?
>
> Then, on writing, if buffer-file-coding-system is not
> locally bound, default-buffer-file-coding-system is tried
> automatically.
>
> And, for the case that buffer-file-coding-system is locally
> bound differently from default-buffer-file-coding-system,
> but it can'd encode the current buffer, we can change
> select-safe-coding-system to try
> default-buffer-file-coding-system before trying the most
> preferred coding system.
>
> That way, I think we can satisfy your request completely.
That seems like a cheap way to get what I want indeed.
Stefan
Re: Cyrillic vs UTF-8, Kenichi Handa, 2003/05/18