emacs-devel
[Top][All Lists]
Advanced

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

Re: How to get buffer byte length (not number of characters)?


From: Eli Zaretskii
Subject: Re: How to get buffer byte length (not number of characters)?
Date: Fri, 23 Aug 2024 15:38:13 +0300

> From: Joseph Turner <joseph@ushin.org>
> Cc: emacs-devel@gnu.org,  schwab@suse.de,  adam@alphapapa.net
> Date: Fri, 23 Aug 2024 00:43:52 -0700
> 
> I'm surprised that
> 
> (with-temp-buffer
>   (insert "你好")
>   (set-buffer-file-coding-system 'chinese-big5)
>   (car (find-coding-systems-region (point-min) (point-max))))
> 
> returns 'utf-8 and not 'chinese-big5.

What does coding-system-priority-list returns in your case?

> Are the codings intended to be
> ordered by priority?

Yes.

> If so, should buffer-file-coding-system be at the front of the list
> if it's safe?

How do you know it's safe?

If your application needs to prefer buffer-file-coding-system, then
you should see if buffer-file-coding-system is a member of the list
returned by find-coding-systems-region, and if so, use that.



reply via email to

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