emacs-devel
[Top][All Lists]
Advanced

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

Re: Design decision of string in Emacs


From: Eli Zaretskii
Subject: Re: Design decision of string in Emacs
Date: Wed, 16 Dec 2020 18:16:52 +0200

> From: Zhu Zihao <all_but_last@163.com>
> Date: Wed, 16 Dec 2020 21:12:41 +0800
> 
> (string-bytes (concat (symbol-name 'GET) (encode-coding-string "我" 'utf-8)))
> ;; => 9

To avoid confusion like this, always encode _last_:

 (string-bytes (encode-coding-string (concat (symbol-name 'GET) "我") 'utf-8))
   => 6



reply via email to

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