[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Differences between identical strings in Emacs lisp
From: |
Stefan Monnier |
Subject: |
Re: Differences between identical strings in Emacs lisp |
Date: |
Tue, 07 Apr 2015 17:10:03 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> both evaluate to (186), indicating that the strings contain the same
> character(s). So they are identical.
No: the "\xBA" string does not contain any character, it only contains
bytes (we call such "string of bytes" a "unibyte string" and the usual
"string of characters" is called a "multibyte string").
And yes, the (integer) codes of the bytes of "\xBA" happen to be
identical to the (integer) codes of the characters of (concat '(#xBA)).
So (equal (append "\xBA" nil) (append "º" nil)) is non-nil.
Note that the same applies to: (equal (append "\xBA" nil) (append [#xBA] nil))
Stefan
- Differences between identical strings in Emacs lisp, Jürgen Hartmann, 2015/04/06
- Re: Differences between identical strings in Emacs lisp,
Stefan Monnier <=
- Re: Differences between identical strings in Emacs lisp, Pascal J. Bourguignon, 2015/04/06
- [Solved] RE: Differences between identical strings in Emacs lisp, Jürgen Hartmann, 2015/04/07
- Re: [Solved] RE: Differences between identical strings in Emacs lisp, Eli Zaretskii, 2015/04/07
- RE: [Solved] RE: Differences between identical strings in Emacs lisp, Jürgen Hartmann, 2015/04/07
- Re: [Solved] RE: Differences between identical strings in Emacs lisp, Eli Zaretskii, 2015/04/07
- RE: [Solved] RE: Differences between identical strings in Emacs lisp, Jürgen Hartmann, 2015/04/08
- Re: [Solved] RE: Differences between identical strings in Emacs lisp, Eli Zaretskii, 2015/04/08
- Re: [Solved] RE: Differences between identical strings in Emacs lisp, Stefan Monnier, 2015/04/08