std/encoding¶
module encoding
Text-safe encodings of a text's UTF-8 octets. An encoding is named by a
type, as a format is: "hé".encode(Hex) is "68c3a9". A decode that
cannot succeed gives none.
Encoding— A text-safe encoding of octets.Hex— A text-safe encoding of octets.Base64— A text-safe encoding of octets.Base64Url— A text-safe encoding of octets.Percent— A text-safe encoding of octets.encode—self's UTF-8 octets written inas:"hé".encode(Hex)is"68c3a9".decode— The textselfencodes inas, ornonewhereselfis not valid in it or the octets are not UTF-8:"aGk/".decode(Base64)issome("hi?").to_bytes— The octetsselfencodes inas, ornonewhere the text is not valid in it:"6869".to_bytes(Hex)issome(0x6869).Bytes— The octetstextencodes inas:Bytes("6869", Hex).