Sentinel enum

Sentinels for signalling the character set of form/query submissions.

Many back-ends historically inspect a hidden "utf8" field in an application/x-www-form-urlencoded payload to infer the charset used by the client. Two conventions emerged:

  • HTML entity for CHECK MARK (U+2713) when the page’s charset does not contain U+2713 (e.g. ISO‑8859‑1). Example raw value: ✓
  • Percent-encoded UTF‑8 octets for U+2713 when the page is UTF‑8.

This enum models both conventions and exposes:

  • value → the unencoded form control value as it appears in the DOM
  • encoded → the ready-to-append query fragment (e.g. utf8=%E2%9C%93)

References: Ruby on Rails' authenticity utf8 param and similar middleware in historical web stacks.

Charset detection sentinels used by form encoders/servers.

Use these constants to append or compare against the conventional utf8 parameter that indicates how a request was encoded.

Inheritance
Available extensions

Values

iso → const Sentinel

HTML entity for CHECK MARK (U+2713), used when the page (or form’s accept-charset) is ISO‑8859‑1 or another charset that lacks U+2713.

Raw form control value: ✓ Encoded query fragment: utf8=%26%2310003%3B

const Sentinel(value: r'✓', encoded: r'utf8=%26%2310003%3B')
charset → const Sentinel

Percent-encoded UTF‑8 octets for CHECK MARK (U+2713), indicating the request itself is UTF‑8 encoded.

Raw form control value: (U+2713) Encoded query fragment: utf8=%E2%9C%93

const Sentinel(value: r'✓', encoded: r'utf8=%E2%9C%93')

Properties

encoded String
Fully encoded query fragment to append, including the utf8= key.
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
Unencoded form control value (as it would appear in the page/DOM).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the encoded query fragment (same as encoded).
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<Sentinel>
A constant List of the values in this enum, in order of their declaration.