Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #150084

Re: Unicode in C Sources

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Unicode in C Sources
Date 2020-02-19 12:17 -0800
Organization A noiseless patient Spider
Message-ID <86h7zme3gs.fsf@linuxsc.com> (permalink)
References (10 earlier) <r19avh$7l4$1@gioia.aioe.org> <r19e0i$5nv$1@dont-email.me> <r19nnk$86a$1@gioia.aioe.org> <r1a1kg$54v$1@dont-email.me> <r1c3t4$174b$1@gioia.aioe.org>

Show all headers | View raw


Manfred <noname@add.invalid> writes:

> On 2/3/2020 9:59 PM, James Kuyper wrote:
>
>> [long discussion of UCNs and extended characters in identifiers]

Let me see if I can clarify what the C standard prescribes here.

The source character set is divided into a basic character set and
a set of extended characters, which is disjoint from the basic
character set.  Somewhat confusingly, the term "extended character
set" includes both the basic character set and the set of extended
characters.

The set of extended characters is locale-specific.  That means it
is implementation-defined, but the definition is allowed to depend
on which locale is in force.

A universal character name is sequence of characters, all of which
are part of the basic character set, in one of two particular
forms:  six characters of the form \unnnn, or ten characters of
the form \Unnnnnnnn, where all the n's are hexidecimal digits.
Not all sequences of this form are valid UCNs:  The value of the
n's must be greater than DFFF, or less than D800 and greater than
009F, or 0024, or 0040, or 0060 (which correspond to dollar, at
sign, and backquote, respectively);  any seeming UCN that
transgresses this rule must provoke a diagnostic.

The mapping from UCNs to characters is well-defined, by taking the
"short identifier" (the hex digits) of the UCN, and looking up the
short identifier in ISO/IEC 10646.

All universal character names are sequences of characters in the
basic character set, and thus are disjoint from the set of
extended characters.  The character a UCN represents might or
might not be the same as an extended character (more on that
farther down), but the UCN itself is not any extended character.

An implementation must allow some UCNs to be used in identifiers.
In particular, it must allow any UCN in the D.1 ranges to be used
in any position after the first, and it must allow any UCN in the
D.1 ranges but not in the D.2 ranges in the first position.  My
reading of the C standard is that these range limitations are
meant to be imposed on the implementation, so any "identifer" that
uses a UCN not meeting these criteria must provoke a diagnostic.

An implementation /may/ allow some members of the set of extended
characters to be used in identifiers.  Which extended characters
are allowed, and (presumably) which extended characters are
allowed initially, is implementation-defined.  On top of that,
how or whether any extended character corresponds to a UCN is
implementation-defined.  There is no restriction on which
extended characters, if any, an implementation may allow to be
part of an identifier (remembering that an extended character
may not belong to the basic character set), as long as they are
documented in the implementation-supplied documentation for
implementation-defined behavior.

Does all this help clear up the relationship between universal
character names and extended characters?

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Unicode in C Sources F Russell <fr@random.info> - 2020-02-01 17:12 +0000
  Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-01 17:37 +0000
    Re: Unicode in C Sources Anton Shepelev <anton.txt@gmail.com> - 2020-02-01 20:43 +0300
      Re: Unicode in C Sources Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-02-01 10:57 -0800
        Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 16:58 +0100
          Re: Unicode in C Sources F Russell <fr@random.info> - 2020-02-02 17:05 +0000
            Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 19:52 +0100
              Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-02 19:20 +0000
            Re: Unicode in C Sources Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-02-03 12:38 +0000
              Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 09:16 -0500
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 15:32 +0100
                Re: Unicode in C Sources Öö Tiib <ootiib@hot.ee> - 2020-02-03 09:01 -0800
                Re: Unicode in C Sources Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-02-03 21:15 +0000
              Re: Unicode in C Sources F Russell <fr@random.info> - 2020-02-04 02:06 +0000
              Re: Unicode in C Sources F Russell <fr@random.info> - 2020-02-04 02:19 +0000
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-04 02:50 +0000
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-04 08:16 +0100
    Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-01 18:10 +0000
      Re: Unicode in C Sources Richard Damon <Richard@Damon-Family.org> - 2020-02-01 15:19 -0500
        Re: Unicode in C Sources Manfred <invalid@add.invalid> - 2020-02-02 00:13 +0100
          Re: Unicode in C Sources Manfred <invalid@add.invalid> - 2020-02-02 00:46 +0100
            Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-02 00:24 +0000
          Re: Unicode in C Sources Richard Damon <Richard@Damon-Family.org> - 2020-02-02 08:14 -0500
            Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-02 17:59 +0100
              Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 14:44 -0500
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-02 21:49 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 16:58 -0500
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-03 15:33 +0100
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-03 15:38 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 10:25 -0500
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-03 19:11 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 15:59 -0500
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-04 16:51 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-04 16:05 -0500
                Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-19 12:17 -0800
      Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 17:09 +0100
        Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 14:46 -0500
          Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-02 21:39 +0100
            Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-02 17:07 -0500
              Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 13:12 +0100
                Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-03 16:46 +0100
                Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-03 16:47 +0000
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 13:36 -0800
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 23:56 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 13:06 -0500
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 22:25 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 13:29 -0800
                Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-19 12:30 -0800
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-19 14:19 -0800
                Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-04-02 07:50 -0700
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-04-02 08:16 -0700
                Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-03 22:33 +0000
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 23:05 -0500
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-03 23:10 -0500
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-04 18:05 +0100
                Re: Unicode in C Sources already5chosen@yahoo.com - 2020-02-04 09:38 -0800
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-04 18:46 +0100
                Re: Unicode in C Sources James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-02-04 16:07 -0500
            Re: Unicode in C Sources Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-02-02 14:54 -0800
      Re: Unicode in C Sources Siri Cruise <chine.bleu@yahoo.com> - 2020-02-03 15:10 -0800
  Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-03 07:47 +0100
    Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 14:00 +0100
      Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-03 16:45 +0100
        Re: Unicode in C Sources Guillaume <message@bottle.org> - 2020-02-03 17:54 +0100
        Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-03 22:36 +0100
          Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-04 16:33 +0100
            Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-04 16:45 +0100
              Re: Unicode in C Sources Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-02-04 13:02 -0800
                Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-04 23:18 +0100
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 11:07 +0100
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-05 14:49 +0100
                Re: Unicode in C Sources Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-02-16 06:23 -0800
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 10:54 +0100
              Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-05 14:51 +0100
                Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-05 14:03 +0000
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 16:31 +0100
                Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-05 15:59 +0000
                Re: Unicode in C Sources scott@slp53.sl.home (Scott Lurndal) - 2020-02-05 16:02 +0000
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 16:59 +0000
                Re: Unicode in C Sources Bart <bc@freeuk.com> - 2020-02-05 18:02 +0000
                Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-05 19:37 +0100
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-05 19:37 +0100
                Re: Unicode in C Sources jacobnavia <jacob@jacob.remcomp.fr> - 2020-02-05 21:02 +0100
                Re: Unicode in C Sources Ian Collins <ian-news@hotmail.com> - 2020-02-06 10:34 +1300
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 23:10 +0000
                Re: Unicode in C Sources Manfred <noname@add.invalid> - 2020-02-06 13:53 +0100
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-06 13:26 +0000
                Re: Unicode in C Sources Richard Damon <Richard@Damon-Family.org> - 2020-02-06 07:27 -0500
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 23:03 +0000
                Re: Unicode in C Sources Mikko Rauhala <mjr@iki.fi> - 2020-02-06 10:46 +0000
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 21:47 +0100
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-05 22:50 +0000
                Re: Unicode in C Sources scott@slp53.sl.home (Scott Lurndal) - 2020-02-07 00:25 +0000
                Re: Unicode in C Sources Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-07 02:07 +0000
                Re: Unicode in C Sources David Brown <david.brown@hesbynett.no> - 2020-02-05 16:26 +0100
      Re: Unicode in C Sources antispam@math.uni.wroc.pl - 2020-04-18 03:58 +0000

csiph-web