- 24 May, 2019 1 commit
-
-
Joe Lee authored
-
- 18 Aug, 2018 1 commit
-
-
Kenton Varda authored
-
- 05 Aug, 2018 1 commit
-
-
Kenton Varda authored
If we were using C++17, we could use [[fallthrough]] instead... but we are not.
-
- 03 Apr, 2018 1 commit
-
-
Harris Hancock authored
Our query string encoding function (encodeWwwForm()) was already doing the right thing. I changed the comment in encodeUriPath() to clarify that it's intended to implement a URL class which stores its path in percent-decoded form, not either/or. I was wrong before.
-
- 29 Mar, 2018 1 commit
-
-
Harris Hancock authored
According to the WHATWG URL spec, each different component of a URL gets its very own percent encode set, which we've been doing wrong this whole time. In terms of reserved characters, the fragment set is a subset of the path set, which is a subset of the userinfo set, which is a subset of RFC 2396's reserved set.
-
- 22 Mar, 2018 1 commit
-
-
Kenton Varda authored
Tested on qemu-aarch64.
-
- 05 Feb, 2018 1 commit
-
-
Harris Hancock authored
These are almost the same as {encode,decode}UriComponent, differing only in the set of characters they consider reserved, and their treatment of spaces. I wasn't sure what to name them -- encodeWwwForm() seemed least bad. For the encode side, I added a completely separate function -- it seemed like more trouble than it was worth trying to integrate the changes into encodeUriComponent(). For the decode side, I integrated the change (plus-to-space) into decodeBinaryUriComponent(), since that function is a bit longer, and the change was trivial.
-
- 20 Jan, 2018 1 commit
-
-
Kenton Varda authored
-
- 11 Dec, 2017 2 commits
-
-
Kenton Varda authored
Different platforms have different sizes for wchar_t. For example: * Linux: 32-bit (originally intended as UCS-4, rarely used in practice) * Windows: 16-bit (originally intended as UCS-2, but now probably treated as UTF-16) * BeOS: 8-bit (strictly intended to be UTF-8) For KJ purposes, we'll assume wchar_t arrays use the UTF encoding appropriate to their size, whatever that may be on the target platform. This is mainly being added because the Win32 API uses wchar_t heavily.
-
Kenton Varda authored
This allows arbitrary char16 arrays to round-trip through UTF-8 without losing information, even if the char16 arrays are not valid UTF-16. This is necessary e.g. for filesystem manipulation on Windows, where filenames contain 16-bit characters but valid UTF-16 is not enforced. Invalid UTF-16 represented in UTF-8 is affectionately known as WTF-8: http://simonsapin.github.io/wtf-8/
-
- 04 Dec, 2017 2 commits
-
-
Harris Hancock authored
-
Harris Hancock authored
This change modifies decodeBase64() to report errors as required by the WHATWG HTML spec's atob() JavaScript function. Notably, it reports errors for non-whitespace characters outside of the valid base64 character range ([+/0-9A-Za-z=]), and performs sanity checks on padding and input length. I took care to keep the algorithm single-pass, and to support streaming via multiple calls of base64_decode_block(), though we don't currently expose that functionality.
-
- 14 Oct, 2017 2 commits
-
-
Ed Catmur authored
for the same reason - if we're called on an empty input, the output might not be a writeable pointer. Results in memory corruption and crash in delete on MSVC.
-
Edward Catmur authored
If we finish decoding in step_a state, there is no current output character, so reading *plainchar will either be an uninitialized read or (if the output buffer is minimally sized) a past-the-end read. Detected by -fsanitize=address.
-
- 12 Oct, 2017 2 commits
-
-
Kenton Varda authored
-
Edward Catmur authored
If we finish decoding in step_a state, there is no current output character, so reading *plainchar will either be an uninitialized read or (if the output buffer is minimally sized) a past-the-end read. Detected by -fsanitize=address.
-
- 30 May, 2017 1 commit
-
-
Kenton Varda authored
-
- 23 May, 2017 2 commits
-
-
Kenton Varda authored
- Rename UtfResult -> EncodingResult - Make it usable like a Maybe, so that we don't need separate "try" functions. - Check errors in hex decoding and URI decoding.
-
Kenton Varda authored
-
- 22 May, 2017 1 commit
-
-
Kenton Varda authored
In particular: UTF-{8,16,32}, Hex, URI encoding, and Base64
-