HINT_NO_NULL_TERMINATOR as you describe would be the perfect solution, of course it should apply to all the String::Write* methods. The source is located in src/api.cc.
On Jul 4, 11:53 pm, Chris Angelico <[email protected]> wrote: > On Tue, Jul 5, 2011 at 6:40 AM, Henrik Lindqvist > <[email protected]> wrote: > > Its more serious than a just little "quirk". Many binary protocols use > > Pascal type strings where the length is stored explicitly, then > > String::WriteUtf8 can't be used. V8 should atleast skip writing \0 > > when HINT_MANY_WRITES_EXPECTED is specified, that would be logical. > > The trouble is, any code written now will expect it to include the \0 > in the count. Would it suit to add an additional hint, eg > HINT_NO_NULL_TERMINATOR, which will then (a) not write the null, and > (b) not include it in the count? > > It'll be a fairly simple change. I could make it when I get to work in > an hour or so, and submit a patch. Where are such things handled? > > Chris Angelico -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
