Re: Unicode: ugh!



"osmium" <r124c4u102@xxxxxxxxxxx> writes:

"Ben Pfaff" writes:

The Unicode standard says this in section 3.9:

"For example, a string is defined as a pointer to char in the
C language, and is conventionally terminated with a NULL
character."

You'd think folks writing standards would bother to properly read
and understand the other standards that they reference.

What's your complaint? That the ASCII null should be spelled NUL?

Here is the definition of a string:

A string is a contiguous sequence of characters terminated
by and including the first null character.

A string is not a pointer to char: it is a sequence of
characters. It is not "conventionally" terminated by a null
character, it is always terminated by one (otherwise it is not a
string). In C, the null terminator is not a NULL character (NULL
is a null pointer constant); it is not the NUL character either,
because that assumes an ASCII character set; the null terminator
is in fact the "null character", as quoted above.

It's amazing how much they managed to get wrong in a single
sentence.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.



Relevant Pages

  • Re: The type of argv in K&R2
    ... has type pointer to character strings. ... members of that array each point to the first character of a string that ... The next member, the member, ...
    (comp.lang.c)
  • Re: file delete routine is intermittent
    ... >> terminator character to every string. ... > Only when you pass a string as a parameter. ... VB does NOT automatically append a null ...
    (microsoft.public.vb.winapi)
  • Re: The type of argv in K&R2
    ... "has type pointer to array of character strings." ... character strings that contain the arguments, ...
    (comp.lang.c)
  • Re: file delete routine is intermittent
    ... >>> terminator character to every string. ... >> Only when you pass a string as a parameter. ... >> character to string members of structures so you must append the null ...
    (microsoft.public.vb.winapi)
  • Re: Initialising a pointer
    ... The value stored in this particular pointer is the address ... first character of a string literal. ... storing its result in a local pointer, and that then does some initial ...
    (comp.lang.c)