syside.EncodingOpts

class EncodingOpts(space_as_plus: bool = False, lower_case: bool = False, disallow_null: bool = False)

Percent-encoding options

These options are used to customize the behavior of algorithms which use percent escapes, such as encoding or decoding.

Initialization

property space_as_plus: bool

True if spaces encode to and from plus signs

This option controls whether or not the PLUS character (“+”) is used to represent the SP character (” “) when encoding or decoding. Although not prescribed by the RFC, plus signs are commonly treated as spaces upon decoding when used in the query of URLs using well known schemes such as HTTP.

property lower_case: bool

True if hexadecimal digits are emitted as lower case

By default, percent-encoding algorithms emit hexadecimal digits A through F as uppercase letters. When this option is true, lowercase letters are used.

property disallow_null: bool

True if nulls are not allowed

Normally all possible character values (from 0 to 255) are allowed, with reserved characters being replaced with escapes upon encoding. When this option is true, attempting to decode a null will result in an error.