1) What do you think about using the term "replace" instead of "disallow"?

sounds good

2) IIRC there was supposed to be some kind of feedback mechanism for the
caller
of WriteUtf8 to inform him that replacements have happened. Do we need this
for
landing the patch?

the feature seems unnecessary, skip it

> think you need to ensure that all return points from this function check for
the
> case that you don't allow invalid utf8, and the last character written is
one
> half of a surrogate pair, which would be incorrectly written as a
replacement
> character in the current implementation

Not sure I understand. If allow_invalid_utf8=false, then any lone surrogate is
an invalid last character, and should be replaced.

right, but if you have the following string:

{lead_surrogate, trail_surrogate}

and you try to write into a buffer of 3 bytes, the correct behaviour is to write
nothing, not write the replacement character as will currently happen

the current implementation doesn't have this problem, as it just writes the lead
surrogate illegally and leaves it to the caller to deal with



https://codereview.chromium.org/121173009/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to