Re: Question about \uxxxx etc. for 21-bit code points - need advice

From: Markus Scherer (markus.scherer@jtcsv.com)
Date: Wed May 24 2000 - 13:55:47 EDT


marco,

we don't preprocess c source code. we use escape sequences in test code to produce unicode strings with non-ascii characters, and in resource bundles, for which we do have our own "compiler".

for example, the italian locale resource bundle contains lines like
    DayNames {
            "domenica",
            "luned\u00EC",
            "marted\u00EC",
            "mercoled\u00EC",
            "gioved\u00EC",
            "venerd\u00EC",
            "sabato",
    }

and our test code contains strings like
        // display langage (French)
        { "anglais", "fran\\u00E7ais", "", "grec", "norv\\u00E9gien", "italien", "xx" },

which, of course, need to be double-escaped so that the c compiler does not unescape them itself. they are unescaped at runtime by a library function.

markus

Marco Cimarosti wrote:
> > I think I will propose to support all of these in our library.
>
> How could a library support this? This is something in the core syntax of the language, and thus you'd need to change the compiler.
>
> If you don't have your own compiler, the closest fit you can achieve is writing an ad-hoc preprocessor to convert source code before is fed to the compiler.
>
> _ Marco



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:03 EDT