all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: rms@gnu.org
Cc: emacs-pretest-bug@gnu.org, 4848@emacsbugs.donarmstrong.com
Subject: bug#4848: 23.1.50; \u and \x in string
Date: Tue, 03 Nov 2009 09:49:54 -0500	[thread overview]
Message-ID: <jwviqdr4quz.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <E1N5JbA-0006xB-8N@fencepost.gnu.org> (Richard Stallman's message of "Tue, 03 Nov 2009 08:39:00 -0500")

>> "\ue1" gives the error "Non-hex digit used for Unicode escape".
>> Why doesn't it work to give the Unicode character á?
>     I think you mean \u00e1
> Why shouldn't \ue1 work?

Because the \u format is \uNNNN with exactly 4 hex digits.

>> Note that \xe1 does not work for this any more.
>     Indeed, this refers to the byte 225 rather than to the char 225.
> This needs to be documented.  But is it a good meaning for \x?  It
> will rarely be useful this way.  Also, is it an incompatible change?

I haven't managed to keep track of all the changes w.r.t how we treat
\NNN vs \xMM vs \xMMMMM and how it impacts whether the resulting string
is unibyte or multibyte.  My understanding is that there have been
several incompatible changes in this area (and some of those were
inevitable).  E.g. in Emacs-22:

   ELISP> "\222"
   "\222"
   ELISP> "\xa4"
   "\xa4"
   ELISP> (multibyte-string-p "\222")
   nil
   ELISP> (multibyte-string-p "\xa4")
   t
   ELISP> (multibyte-string-p "\xa45")
   t
   ELISP> 

whereas in Emacs-23.1:

   ELISP> "\222"
   "\222"
   ELISP> "\xa4"
   "\244"
   ELISP> (multibyte-string-p "\222")
   nil
   ELISP> (multibyte-string-p "\xa4")
   nil
   ELISP> (multibyte-string-p "\xa45")
   t
   ELISP> 

Of course, given that fact that char-numbers have changed, the
backward compatibility of \xNNNN is irrelevant since they do not
represent the same char any more.


        Stefan





  reply	other threads:[~2009-11-03 14:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  5:31 bug#4848: 23.1.50; \u and \x in string Richard Stallman
2009-11-02  7:17 ` Stefan Monnier
2009-11-02  7:33   ` Jason Rumney
2009-11-03 13:39   ` Richard Stallman
2009-11-03 14:49     ` Stefan Monnier [this message]
2009-11-05  1:57       ` Richard Stallman
2009-11-05  2:48         ` Stefan Monnier
2009-11-03 18:35     ` Eli Zaretskii
2009-11-05  1:56       ` Richard Stallman
2016-06-14  2:45 ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwviqdr4quz.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=4848@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.