Table of Contents

PercentEncodingMode Enum

Definition

Namespace
Bodu.Text.Encoding
Assembly
Bodu.Text.Encoding.dll
Package
Bodu.Text.Encoding 1.0.0
Source
PercentEncodingMode.cs

Identifies the set of characters PercentEncoding leaves unescaped, selecting the URI component or form-encoding rules to apply.

public enum PercentEncodingMode : byte
Extension Methods

Fields

UriComponent = 0

Encodes every byte except the RFC 3986 unreserved set (ALPHA / DIGIT / - / . / _ / ~). The safest default for an independent value embedded into any URI component.

PathSegment = 1

Encodes for a single RFC 3986 path segment: passes through unreserved characters, sub-delimiters, :, and @, while encoding /, ?, and #. Encode each segment separately and join with /.

Query = 2

Encodes for a whole RFC 3986 query component: passes through unreserved characters, sub-delimiters, :, @, /, and ?, while encoding #. For individual parameter names and values prefer UriComponent or FormUrlEncoded.

FormUrlEncoded = 3

Encodes per the WHATWG application/x-www-form-urlencoded percent-encode set: passes through only ASCII alphanumerics and *, -, ., _; encodes space as +, a literal plus as %2B, and a literal percent as %25.

Applies to

ProductVersions
.NET8, 10