Re: U+0000 in C strings (was: Re: Opinions on this Java URL?)

From: Doug Ewell (
Date: Mon Nov 15 2004 - 10:13:56 CST

  • Next message: Doug Ewell: "Re: U+0000 in C strings"

    John Cowan <jcowan at reutershealth dot com> wrote:

    >> A 32-bit length count, followed by an array of N arbitrary Unicode
    >> characters, would probably be the best implementation today.
    > Which is essentially what the Java String class has, if you unwrap it.

    Then why do the DataInput and DataOutput interfaces perform this special
    conversion? There isn't any mention, on the page whose URL Theodore
    originally provided, of compatibility with C strings. If a Java String
    consists of a count followed by the data, why would "embedded nulls" in
    the data make any difference?

    >> I'd still like to know what practical, real-world TEXT-related
    >> benefits would derive from allowing U+0000 in strings of TEXT in a C
    >> program.
    > Simplicity and generality.

    Those are design benefits. I was asking about the ability to represent
    text adequately.

    -Doug Ewell
     Fullerton, California

    This archive was generated by hypermail 2.1.5 : Mon Nov 15 2004 - 10:20:50 CST