all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [wenbinye@gmail.com: hexl-max-address in hexl-mode is incorrect]
Date: Wed, 22 Nov 2006 11:59:14 -0500	[thread overview]
Message-ID: <87bqmzo1st.fsf@cyd.mit.edu> (raw)
In-Reply-To: <87bqmzo4fl.fsf@cyd.mit.edu> (Chong Yidong's message of "Wed\, 22 Nov 2006 11\:02\:22 -0500")

>> 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.

  reply	other threads:[~2006-11-22 16:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-19  7:59 [wenbinye@gmail.com: hexl-max-address in hexl-mode is incorrect] Richard Stallman
2006-11-22 16:02 ` Chong Yidong
2006-11-22 16:59   ` Chong Yidong [this message]
2006-11-22 17:15   ` Kevin Rodgers
2006-11-22 22:02     ` Chong Yidong
2006-11-27 19:09       ` Stuart D. Herring
2006-11-28  0:48         ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bqmzo1st.fsf@cyd.mit.edu \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.