https://codereview.chromium.org/121173009/diff/130001/src/unicode-inl.h
File src/unicode-inl.h (right):
https://codereview.chromium.org/121173009/diff/130001/src/unicode-inl.h#newcode155
src/unicode-inl.h:155: // @TODO give this the same semantics as Encode?
i don't see an easy way to do this. You'd have to then run over the
byte stream with a second pass to adjust for matching surrogates, but
the current implementation here already doing that correctly and
efficiently for the case where the replacement character is inserted and
the case that it isn't.
I think you'll ultimately need to keep the rewriting above in
Utf8::Encode as it is instead of moving it to WritePair in api.cc.
Instead you can just write kReplacementCharacter if the flag is set.
This makes the Length and Encode functions easier to understand, since
they complement one another and are in the same place. Also, you won't
have to change any other call sites of Encode, which is of great
benefit.
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.