EncodingOpts

class EncodingOpts

Percent-encoding options

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

Members defined in EncodingOpts (4 members)

disallow_null

RW

True if nulls are not allowed

lower_case

RW

True if hexadecimal digits are emitted as lower case

space_as_plus

RW

True if spaces encode to and from plus signs

__init__

Attributes

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.

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 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.

Methods

__init__(space_as_plus: bool = False, lower_case: bool = False, disallow_null: bool = False) None
Used in