Subject: Re: (SC22WG14.165) Re: support for symbolic character names

From: Keld J|rn Simonsen <[email-masked]>
Date: Mon, 6 Jan 92 20:34:34 +0100

> I have a basic question.
> 
> What is the purpose of these two functions?  Or, in other words,
> what kind of application will use them?
> 
> The only usage I could imagine was to implement localdef-level
> utilities.  If so, I don't think it is out of scope of the C
> standardization.
> 
> Am I missing some points?
> 
> 
> By the way,
> 
> > In wchar_t character and string constants, occurrances of the
> > form \<scn> are replaced with the scntowc(scn) value.
> 
> I don't understand the meaning of the above sentence.  Could you
> explain more, Keld?

The comments I got was also that people did not understand what these
functions were for, and people asked me to provide further information,
including a rationale and a programming model.

The mechanism is to support portability of international C programs.
Consider a text with my name in it, Keld J|rn Simonsen.
The | looks fine on my terminal, but probably not on yours.
It is a lowercase-o-with-stroke. If I want to write a portable
program, which tests for this letter, then it is very difficult.
It depends on the execution character set. In the one I am really
using now (IBM865) it is one value, in ISO8859-1 it is another,
and ind MacIntosh it is yet another. If  I can use the localedef
notation, I would just refer to the symbolic character name,
and the execution locale will do the proper naming for me.
If o/ denotes o-with-stroke I could write:

          if (c == '\<o/>') ....

The side effect is that I can actually maintain my programs
on an ASCII terminal and have it printed on simple printers.
Or I can maintain my programs on an 8859-1 terminal and
write for 10646 equipment (or ASCII term for 10646 equip).

The mechanism is an extension to the current C character names
like  \t \n for tab and newline - and much in line with
POSIX localedef style.

The mechanism is much in line with current documenter software
like TeX or SGML that has such symbolic names for "weird" characters.

Keld