Dnia 05-04-2007, czw o godzinie 02:04 -0400, Rich Felker napisał(a):

> Just look how much that already happens anyway... the use
> of : as a separator in PATH-type strings, the use of spaces to
> separate command line arguments, the use of = to separate environment
> variable names from values, etc..

Do you propose to replace them with NULs? This would make no sense.
A single environment variable can contain a whole PATH-type string.
You can’t use NUL to delimit the whole string *and* its components
at the same time. Different contexts require different delimiters
if a string from one context is to be able to contain a sequence of
another one.

> Having a character you know can't
> occur in text (not just by arbitrary rules, but because it's actually
> impossible for it to be passed in a C string) is nice because there's
> at least one character you know is always safe to use for app-internal
> in-band signalling.

Here you contradict yourself:

> Notice also how GNU find/xargs use NUL to cleanly
> separate filenames, relying on the fact that it could never occur
> embedded in a filename.

because you show an example where NUL *is* used in text, and it’s used
not internally but in communication between two programs.

> > The other languages handle all 256 byte values consistently.
> 
> Which ones?

All languages besides C, except toy interpreters written in C by some
students.

> There are plenty of languages which can't handle control characters in
> strings well at all, much less NUL.

I don’t know any such language.

> Because C was there first and C is essentially the only standardized
> language.

Nonsense.

> When your applications run on top of a system build upon C
> and POSIX you have to play by the C and POSIX rules.

Only during communication with the system.

The only influence of C on string representation in other languages
is that it’s common to redundantly have NUL stored after the string
*in addition* to storing the length explicitly, so in cases the string
doesn’t contain NUL itself it’s possible to pass the string to a C
function without copying its contents.

-- 
   __("<         Marcin Kowalczyk
   \__/       [EMAIL PROTECTED]
    ^^     http://qrnik.knm.org.pl/~qrczak/


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

Reply via email to