I've noticed this too. It always write and counts the null-terminator,
even when specifying HINT_MANY_WRITES_EXPECTED. This makes WriteUtf8
somewhat useless when used to encode a string into a binary buffer
where you don't want null-termination, i.e. sockets transfer.

On Jul 4, 6:41 am, Chris Angelico <[email protected]> wrote:
> String::Write and String::WriteAscii count characters (in the latter
> case, that's the same as bytes) written, not counting the null
> terminator. But String::WriteUtf8 counts bytes, and includes the null
> terminator. I assume there is a reason for this anomaly, since it's
> explicit in the documentation as well as being visible in the source.
> Can someone fill me in? I've been puzzling over this for a while,
> which is largely my own fault for not reading the docs!
>
> Chris Angelico

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to