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

Re: detect-coding-with-priority



In article <b4mabncj4t4.fsf@xxxxxxx>, Katsumi Yamaoka <yamaoka@xxxxxxx> writes:

> I noticed that `detect-coding-with-priority' doesn't work
> recently in the Emacs trunk and Unicode-2, though I don't know
> when it began.

> (with-temp-buffer
>   (set-buffer-multibyte nil)
>   (insert (encode-coding-string "あいうえお" 'shift_jis))
>   (detect-coding-with-priority (point-min) (point-max)
> 			       '((coding-category-sjis . shift_jis))))
>>> (raw-text no-conversion)

I think the following change is the culprit.

2008-01-09  Kenichi Handa  <handa@xxxxxxxxxxxxx>

	* coding.c (detect_coding_iso2022): New arg
	latin_extra_code_state.  Allow Latin extra codes only
	when *latin_extra_code_state is nonzero.
	(detect_coding_mask): If there is a NULL byte, detect the encoding
	as UTF-16 or binary.  If Latin extra codes exist, detect the
	encoding as ISO-2022 only when there's no other proper encoding is
	found.

I'm now investigating what's wrong.

---
Kenichi Handa
handa@xxxxxxxxxxxxx