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: Eli Zaretskii
Subject: bug#16048: 24.3.50; String compare surprise
Date: Wed, 04 Dec 2013 19:34:37 +0200

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Wed, 04 Dec 2013 15:05:00 +0100
> Cc: 16048-done@debbugs.gnu.org
> 
> Ah, well. In `dbus-unescape-from-identifier', there is
> 
>      (lambda (x) (format "%c" (string-to-number (substring x 1) 16)))
> 
> If I replace it by
> 
>      (lambda (x) (byte-to-string (string-to-number (substring x 1) 16)))
> 
> everything works fine.

Beware: byte-to-string returns a unibyte string.  You do NOT want
unibyte strings in your application code.  The problem you had that
started this thread is a very good demonstration why.

So I would leave dbus-unescape-from-identifier intact, and instead fix
the other side of the string comparison, the one that yields "\377".





reply via email to

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