From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?B?SvxyZ2VuIEhhcnRtYW5u?= Newsgroups: gmane.emacs.help Subject: Differences between identical strings in Emacs lisp Date: Mon, 6 Apr 2015 15:21:46 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1428326535 9627 80.91.229.3 (6 Apr 2015 13:22:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Apr 2015 13:22:15 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 06 15:22:08 2015 Return-path: Envelope-to: geh-help-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 1Yf6yd-0001H2-O9 for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Apr 2015 15:22:07 +0200 Original-Received: from localhost ([::1]:40101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf6yc-0002PG-Qg for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Apr 2015 09:22:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf6yS-0002P8-DO for help-gnu-emacs@gnu.org; Mon, 06 Apr 2015 09:21:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yf6yK-0001Ev-Kv for help-gnu-emacs@gnu.org; Mon, 06 Apr 2015 09:21:56 -0400 Original-Received: from dub004-omc4s12.hotmail.com ([157.55.2.87]:55795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf6yK-0001Ef-6q for help-gnu-emacs@gnu.org; Mon, 06 Apr 2015 09:21:48 -0400 Original-Received: from DUB124-W48 ([157.55.2.71]) by DUB004-OMC4S12.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 6 Apr 2015 06:21:46 -0700 X-TMN: [BJ8ks5AE/GFKrIgMs+mSrbAnc2GaXsJV] X-Originating-Email: [juergen_hartmann_@hotmail.com] Importance: Normal X-OriginalArrivalTime: 06 Apr 2015 13:21:46.0903 (UTC) FILETIME=[A1EA9A70:01D0706C] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 157.55.2.87 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103547 Archived-At: What is the difference between the string represented by the constant "\xBA= "=0A= and the result of (concat '(#xBA))?=0A= =0A= Background:=0A= =0A= When I start Emacs 24.4 in Linux with the -Q option and the POSIX locale to= =0A= have clean conditions=2C i.e.=0A= =0A= =A0=A0 LC_ALL=3DC emacs -Q=0A= =0A= the evaluation of=0A= =0A= =A0=A0 "\xBA"=0A= =0A= in *scratch* (lisp interaction mode) yields a result=0A= printed as "\272".=0A= =0A= In contrast to that=2C the result of=0A= =0A= =A0=A0 (concat '(#xBA))=0A= =0A= is printed as "=BA"=2C i.e. the "masculine ordinal indicator" glyph in doub= le=0A= quotes. The glyph's character is described by the command describe-char as= =0A= follows:=0A= =0A= ---------------------------------------------------------------------------= --=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 position: 235 of 341 (69%)=2C column: = 1=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 character: =BA (displayed as =BA) (codepo= int 186=2C #o272=2C #xba)=0A= =A0=A0=A0 preferred charset: unicode (Unicode (ISO10646))=0A= code point in charset: 0xBA=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 script: latin=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 syntax: _ =A0=A0=A0 which means:= symbol=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 category: .:Base=2C L:Left-to-right (s= trong)=2C h:Korean=2C j:Japanese=2C l:Latin=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 to input: type "C-x 8 RET HEX-CODEPOIN= T" or "C-x 8 RET NAME"=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0 buffer code: #xC2 #xBA=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 file code: #xC2 #xBA (encoded by coding s= ystem nil)=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 display: by this font (glyph code)= =0A= =A0=A0=A0 xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0= -iso10646-1 (#x7C)=0A= =0A= Character code properties: customize what to show=0A= =A0 name: MASCULINE ORDINAL INDICATOR=0A= =A0 general-category: Lo (Letter=2C Other)=0A= =A0 decomposition: (super 111) (super 'o')=0A= =0A= There are text properties here:=0A= =A0 face=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 font-lock-string-f= ace=0A= =A0 fontified=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 t=0A= =0A= [back]=0A= ---------------------------------------------------------------------------= --=0A= =0A= Obviously the result of (concat '(#xBA)) gets interpreted (decoded) on the= =0A= basis of the unicode charset=2C while "\xBA" is treated as a raw byte.=0A= =0A= Comparing these strings directly also shows hat they are different:=0A= =0A= =A0=A0 (string=3D "\xBA" (concat '(#xBA)))=0A= =0A= evaluates to nil.=0A= =0A= On the other hand=2C the expressions=0A= =0A= =A0=A0 (append "\xBA" ())=0A= =0A= and=0A= =0A= =A0=A0 (append (concat '(#xBA)) ())=0A= =0A= both evaluate to (186)=2C indicating that the strings contain the same=0A= character(s). So they are identical.=0A= =0A= How to resolve this contradiction?=0A= =0A= Since I could not find a clue in the manuals or via google=2C any explanati= on=2C=0A= idea=2C hint=2C link is greatly appreciated.=0A= =0A= Juergen=0A= =0A= =