[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: hexl-max-address in hexl-mode is incorrect]
From: |
Chong Yidong |
Subject: |
Re: address@hidden: hexl-max-address in hexl-mode is incorrect] |
Date: |
Wed, 22 Nov 2006 11:59:14 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) |
>> The hexl-max-address usually set to buffer-size, but when the buffer
>> contain a multiple byte character or the file associated to the buffer
>> is encoded by multibyte coding system such as utf-16, the
>> hexl-max-address is usually less the the real byte of buffer.
>
> However, the (decode-coding-string (buffer-string) buffer-file-coding-system)
> method doesn't seem to work for me; it returns erratic incorrect
> results.
Actually, I think the correct thing to do is to ENcode the buffer
string, not DEcode it.
(length (encode-coding-string (buffer-string) buffer-file-coding-system))
This seems to produce the correct results.