[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTF16 and GCC



Hi Bruno,

On Fri, 13 Jul 2001, Bruno Haible wrote:
> Christoph Rohland writes:
> 
>> Yes, but perhaps we could try to make that standard?
> 
> There is a chance to make the u"..." syntax(es) standard.
> 
> Personally I don't think it is possible to standardize the way a
> compiler detects the encoding of an input file. Some, like gcc, will
> want to use UTF-8 as the default, some others will want to use the
> locale encoding.

But that would be pretty broken. Where do I get the locale from? The
environment of the compiler =:-0

>> > (Can't we use uint_least16_t instead of utf16_t?)
>> 
>> No, I think one of the biggest mistakes in the C standard is that
>> char/wchar_t is not fixed. We need an exact 16 bit type with a
>> defined encoding.
> 
> Joseph Myers explained why you won't get such a type (and why ISO C
> 99 section 7.18.1.1.(3) says that uint8_t, uint16_t and uint32_t are
> optional): Some hardware has a word size of 9, 16, 32, or 36 bit,
> and GCC and C99 support such hardware.

As long as it is 16 bit on reasonable hardware (read char==8bit),
that's fine with me.

And IMHO everything else is still a design mistake.

>> > Currently only on glibc systems. wchar_t == UCS-4 is only a
>> > recommendation in ISO C 99, not mandatory (unfortunately).
>> 
>> No, it will be on all Unix systems we support: Solaris, True64,
>> HPUX, AIX5L, Reliant.
> 
> Did you get a firm confirmation from Sun people that in some version
> of Solaris, wchar_t will be UCS-4 in all locales and
> __STDC_ISO10646__ will be defined? In which version of Solaris?

That's at least what both the SUN guys and our Unicode guys told me.

Greetings
		Christoph


-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/