bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16048: 24.3.50; String compare surprise


From: Josh
Subject: bug#16048: 24.3.50; String compare surprise
Date: Wed, 4 Dec 2013 06:00:46 -0800

On Wed, Dec 4, 2013 at 5:07 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
michael.albinus@gmx.de writes:

> The following form evals to nil:
>
>   (string-equal "\377" "ÿ")

"\377" is a unibyte string.  When converted to multibyte it yields
"\x3fffff".

At least as of 24.3, the manual[0] suggests that such a conversion
should not occur in this case:

    You can also use hexadecimal escape sequences (`\xN') and octal
    escape sequences (`\N') in string constants.  *But beware:* If a
    string constant contains hexadecimal or octal escape sequences,
    and these escape sequences all specify unibyte characters (i.e.,
    less than 256), and there are no other literal non-ASCII
    characters or Unicode-style escape sequences in the string, then
    Emacs automatically assumes that it is a unibyte string.  That is
    to say, it assumes that all non-ASCII characters occurring in the
    string are 8-bit raw bytes.

[0] (info "(elisp) Non-ASCII in Strings")

Josh
 

reply via email to

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