all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: Unicode character read representation
Date: Fri, 27 Feb 2009 09:51:01 +0900	[thread overview]
Message-ID: <E1LcqwP-0004B6-Kf@etlken> (raw)
In-Reply-To: <jwvzlg9dyo4.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 26 Feb 2009 10:08:53 -0500)

In article <jwvzlg9dyo4.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > For instance 0xFFFF is a valid Unicode code-point, but is
> > not a character.  Should it be accepted or not?

> Yes, it should.  But I think that \u3FFFFF shouldn't since it's not
> a valid unicode code point.

Ok, I've just installed this change.

Index: lread.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/lread.c,v
retrieving revision 1.403
retrieving revision 1.404
diff -u -r1.403 -r1.404
--- lread.c	25 Feb 2009 12:47:24 -0000	1.403
+++ lread.c	27 Feb 2009 00:48:03 -0000	1.404
@@ -2205,7 +2205,7 @@
       /* A Unicode escape. We only permit them in strings and characters,
 	 not arbitrarily in the source code, as in some other languages.  */
       {
-	int i = 0;
+	unsigned int i = 0;
 	int count = 0;
 
 	while (++count <= unicode_hex_count)
@@ -2222,7 +2222,8 @@
 		break;
 	      }
 	  }
-
+	if (i > 0x10FFFF)
+	  error ("Non-Unicode character: 0x%x", i);
 	return i;
       }
 
---
Kenichi Handa
handa@m17n.org




  reply	other threads:[~2009-02-27  0:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-21 14:07 Unicode character read representation Chong Yidong
2009-02-21 14:22 ` Harald Hanche-Olsen
2009-02-24 11:14 ` Kenichi Handa
2009-02-24 22:16   ` Stefan Monnier
2009-02-26  7:28     ` Kenichi Handa
2009-02-26 15:08       ` Stefan Monnier
2009-02-27  0:51         ` Kenichi Handa [this message]
2009-02-27  1:45           ` Chong Yidong

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=E1LcqwP-0004B6-Kf@etlken \
    --to=handa@m17n.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.