Re: Multibyte definition

From: John Cowan (jcowan@reutershealth.com)
Date: Fri Mar 17 2000 - 12:53:17 EST


Marco.Cimarosti@icl.com wrote:

A few emendations:

> - "Byte": (1) the unit of measure for memory, as returned by operator
> 'sizeof'. Nothing more is implied, although 8 bits is a common size.

Must have at least 8 bits.
 
> - "Type 'char'": an integer whose site is one "byte" (in C terms). Among
> other things, it is guaranteed that its size is <= to the size of type
> 'wchar_t' ('sizeof(char) <= sizeof(wchar_t)' is always true; 'sizeof(char) <
> sizeof(wchar_t)' is *not* always true).

sizeof(char) is guaranteed to be 1. Chars may be signed or unsigned, so
the portable range is 0 to 127. Unsigned chars have a portable range
of 0 to 255, fortunately.

> - "Multibyte string": an array of type 'char' (e.g. 'char mbstr [10] =
> "Ciao!"'). Nothing else is implied;

Terminated by a '\0'.

> - "Wide string": an array of type 'wchar_t' (e.g. 'wchar_t wstr [10] =
> L"Ciao!"'). Nothing else is implied.

Terminated by a L'\0'.

-- 

Schlingt dreifach einen Kreis um dies! || John Cowan <jcowan@reutershealth.com> Schliesst euer Aug vor heiliger Schau, || http://www.reutershealth.com Denn er genoss vom Honig-Tau, || http://www.ccil.org/~cowan Und trank die Milch vom Paradies. -- Coleridge (tr. Politzer)



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