This commit refactors all functions so they have consistent behavior for the space-as-plus encoding option.
- any_params_iter objects store and apply the appropriate option when measuring and copying
- when the option is enabled, encoding functions encode space-as-plus and plus as %2B regardless of the charset
- normalization and comparison algorithms take into consideration special query chars whose meaning changes depending on encoding
- all params_view objects created with default options enable space-as-plus encoding
fix#903
This commit simplifies duplicated code so that we tests all paths for the pct_string_view::decode function. Unreachable paths are also marked.
This is a partial solution to #828, where src/detail/decode.cpp has low coverage.
The private unsafe encoding functions received a parameter to determine the encoding options. However, these functions are never used in any context where these options should diverge from the default values.
This is a partial solution to #828, where `detail/encode.hpp` is the file with the lowest coverage.
Fixes#758
The parsing and measuring code didn't have explicit handling for integer
zero, and the while(v > 0) loop wouldn't execute.
Also add tests to cover both of these cases.