Subject: support for symbolic character names

From: Keld J|rn Simonsen <[email-masked]>
Date: Sun, 29 Dec 91 00:34:29 +0100

Here is the paper I presented at the WG14 C meeting in Milano.

keld
----
                                            SC22/WG14 N197

Title: Support for Symbolic Character Names in MSE

Source: Keld Simonsen, DS

Status: Expert Contribution

Date: 1991-12-12

Locales are often specified with symbolic character names,
to improve portability across different coded character sets.
Two new functions and a notation for character
constants are proposed to utilize these specifications,
to provide greater portability of program sources.

wchar_t scntowc(const char *scn);

The scntowc function finds the widechar value for the symbolic
character name scn in the current locale.

The scntowc function returns the widechar value for the 
symbolic character name scn. If no widechar value is found,
it returns EOF.

size_t wctoscn(wchar_t wc, int pos, char *scn, size_t maxl);

The wctoscn function locates the pos number symbolic
character name of the current locale for the widechar value wc.
There may be more than one name for each wc.

The wctoscn function copies the symbolic character name found
to the character string scn, at most maxl bytes. The return value
is the number of bytes copied to scn. If no symbolic character
name is found, the return value is zero.

In wchar_t character and string constants, occurrances of the
form \<scn> are replaced with the scntowc(scn) value.