From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16048: 24.3.50; String compare surprise Date: Wed, 04 Dec 2013 19:29:30 +0200 Message-ID: <831u1s4j9h.fsf@gnu.org> References: <87r49six1s.fsf@igel.home> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1386178272 24172 80.91.229.3 (4 Dec 2013 17:31:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Dec 2013 17:31:12 +0000 (UTC) Cc: michael.albinus@gmx.de, schwab@linux-m68k.org, 16048@debbugs.gnu.org To: Josh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 04 18:31:16 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VoGI7-0006sb-5A for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2013 18:31:15 +0100 Original-Received: from localhost ([::1]:49549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoGI6-0006pP-LU for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2013 12:31:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoGHy-0006pK-Ug for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 12:31:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoGHu-0002D9-AF for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 12:31:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoGHu-0002D4-67 for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 12:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VoGHt-00042p-ML for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 12:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Dec 2013 17:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16048 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16048-submit@debbugs.gnu.org id=B16048.138617821215481 (code B ref 16048); Wed, 04 Dec 2013 17:31:01 +0000 Original-Received: (at 16048) by debbugs.gnu.org; 4 Dec 2013 17:30:12 +0000 Original-Received: from localhost ([127.0.0.1]:58254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoGH4-00041b-UF for submit@debbugs.gnu.org; Wed, 04 Dec 2013 12:30:11 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:58509) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoGGy-00040g-S3 for 16048@debbugs.gnu.org; Wed, 04 Dec 2013 12:30:06 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MXA00H00LW91300@a-mtaout22.012.net.il> for 16048@debbugs.gnu.org; Wed, 04 Dec 2013 19:29:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MXA00GHDLX8FGC0@a-mtaout22.012.net.il>; Wed, 04 Dec 2013 19:29:32 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81377 Archived-At: > From: Josh > Date: Wed, 4 Dec 2013 06:00:46 -0800 > Cc: Michael Albinus , 16048@debbugs.gnu.org > > On Wed, Dec 4, 2013 at 5:07 AM, Andreas Schwab 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: And it doesn't occur, indeed: (multibyte-string-p "\377") => nil > 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") Best citation contest? you're on! -- Function: string= string1 string2 This function returns `t' if the characters of the two strings match exactly. Symbols are also allowed as arguments, in which case the symbol names are used. Case is always significant, regardless of `case-fold-search'. [...] For technical reasons, a unibyte and a multibyte string are `equal' if and only if they contain the same sequence of character codes and all these codes are either in the range 0 through 127 (ASCII) or 160 through 255 (`eight-bit-graphic'). However, when a unibyte string is converted to a multibyte string, all characters with codes in the range 160 through 255 are converted to characters with higher codes, whereas ASCII characters remain unchanged. Thus, a unibyte string and its conversion to multibyte are only `equal' if the string is all ASCII. Note the last sentence.