W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2002

Re: DOMString NULL-termination?

From: Ray Whitmer <rayw@netscape.com>
Date: Mon, 08 Apr 2002 14:30:20 -0700
Message-ID: <3CB20BEC.4000201@netscape.com>
To: Ian Macky <ian.macky@oracle.com>
CC: www-dom@w3.org, Tomas Saulys <tsaulys@us.oracle.com>, "Benjamin C. Chang" <bcchang@us.oracle.com>
That is intentionally unspecified, as long as it is able to properly 
represent the sequences of characters, including all legal XML characters.

The actual choice of type is left up to the binding, as long as it meets 
the basic rules of being a sequence of 16-bit units. In Java, it mapps 
to the built-in string object, which clearly is not null-terminated and 
may contain nullswithin the string.  So, if you have a concrete binding, 
you need to see how that binding declares it.  If you are creating a new 
binding, you should compare your own binding's native types and try to 
choose the best one, or if there is nothing adequate, you may need 
something new.  The choice gets trickier if you want something that will 
work across multiple bindings, some of whose string types may already be 
concretely specified, such as binding a COM implementation to Javascript 
or Perl.

Ray Whitmer
rayw@netscape.com

Ian Macky wrote:

>Greetings.  A question about DOMString type:
>
>    Are DOMStrings supposed to be NULL-terminated (de facto
>    C standard), or length-encoded (somehow)?
>
>Nowhere can I find a specification for the format of a DOMString,
>beyond "A DOMString is a sequence of 16-bit units" (CORE 1.1.5).
>
>Please reply to me directly or cc as I am not on the mailing list.
>
>Thanks.
>
>--ian
>
Received on Monday, 8 April 2002 17:31:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:56 GMT