Repository navigation
test: Add two more urlDecode tests - #29967
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
|
Code review ACK fa55972 |
|
ACK fa55972 super-mini-nit: In the commit message, |
| BOOST_CHECK_EQUAL(UrlDecode(" %Z "), " %Z "); | ||
| BOOST_CHECK_EQUAL(UrlDecode(" % X"), " % X"); | ||
|
|
||
| BOOST_CHECK_EQUAL(UrlDecode("%%ffg"), "%\xffg"); |
There was a problem hiding this comment.
I had to scratch my head on this one...
It iterates from left to right, the first thing it finds is %. It then tries if the next two characters are hex, which they are not, so it puts the literal % in the result. Then it moves to the next % which is followed by valid hex ff. Since 0xff is invalid unicode, we have to represent it with the escape sequence "\xff". And then there's the regular character g.
Trivial follow-up after #29904 (comment)