Chrome Version: ToT later than r560505
OS: All
What steps will reproduce the problem?
(1) Open the following HTML:
<!DOCYPE html>
<form action="">
<input>
</form>
<script>
document.querySelector('input').name = 'n1\n2\uDC00';
document.querySelector('input').value = 'def\uDFFFghi';
var fd2 = new FormData(document.querySelector('form'));
var b5 = fd2.has('n1\n2\uFFFD');
alert('query: ' + b5)
</script>
What is the expected result?
It shows an alert dialog with 'query: true'
What happens instead?
It shows an alert dialog with 'query: false'
Please use labels and text to provide additional information.
It worked because FormData::Entry stored UTF8-encoded CString, and UTF8 encoder replaces U+DC00 with U+FFFD. Since r560505, we skip UTF8 encode.
Comment 1 by bugdroid1@chromium.org
, May 23 2018