ddn.data.xml.internal.encoding
Internal: UTF-8 validation and normalization helpers.
This module is not part of the public API and may change at any time.
Types 2
Detected input encoding.
UTF8UTF-8.
UTF16_LEUTF-16, little-endian.
UTF16_BEUTF-16, big-endian.
UTF32_LEUTF-32, little-endian.
UTF32_BEUTF-32, big-endian.
ISO_8859_1ISO-8859-1 (Latin-1).
WINDOWS_1252Windows-1252 (CP1252).
enumXmlVersion
XML version used for version-dependent checks.
XML_1_0XML 1.0
XML_1_1XML 1.1
Functions 12
fn
XmlDetectedEncoding encodingFromName(string name) @safeMaps an encoding name to `XmlDetectedEncoding`.fn
string tryParseXmlEncodingDeclarationAscii(const(ubyte)[] bytes) @safeAttempts to parse the XML declaration `encoding='...'` pseudo-attribute from raw bytes.fn
XmlDetectedEncoding encodingFromLabel(string label, out bool supported) @safeMaps a declared encoding label to an internal decoding choice.fn
bool isValidXmlChar(dchar c, XmlVersion xmlVersion = XmlVersion.XML_1_0) @safe pure nothrowReturns `true` if `c` is a valid XML character.fn
size_t utf8BomLength(const(ubyte)[] bytes) @safe pure nothrowReturns the length of a UTF-8 BOM prefix in `bytes`.fn
XmlDetectedEncoding detectEncoding(const(ubyte)[] bytes) @safe pure nothrowDetects the encoding of `bytes`.fn
string decodeToUtf8(const(ubyte)[] bytes, XmlDetectedEncoding encoding) @safeDecodes `bytes` into a UTF-8 `string` using the detected encoding.fn
bool isValidUtf8(const(ubyte)[] bytes) @safe pure nothrowValidates that `bytes` is well-formed UTF-8.