From 8966edb60bc07bc31897715087b4517d4ca03ace Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Sat, 15 Oct 2022 12:23:39 +0300 Subject: [PATCH] Add remarks about the purpose of the output encoding concept --- src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 05e735c..9174346 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,8 +169,10 @@ //! //! The Encoding Standard doesn't specify encoders for UTF-16LE and UTF-16BE, //! __so this crate does not provide encoders for those encodings__! -//! Along with the replacement encoding, their _output encoding_ is UTF-8, -//! so you get an UTF-8 encoder if you request an encoder for them. +//! Along with the replacement encoding, their _output encoding_ (i.e. the +//! encoding used for form submission and error handling in the query string +//! of URLs) is UTF-8, so you get an UTF-8 encoder if you request an encoder +//! for them. //! //! Additionally, the Encoding Standard factors BOM handling into wrapper //! algorithms so that BOM handling isn't part of the definition of the @@ -2928,6 +2930,9 @@ impl Encoding { /// Returns the _output encoding_ of this encoding. This is UTF-8 for /// UTF-16BE, UTF-16LE and replacement and the encoding itself otherwise. /// + /// Note: The _output encoding_ concept is needed for form submission and + /// error handling in the query strings of URLs in the Web Platform. + /// /// Available via the C wrapper. #[inline] pub fn output_encoding(&'static self) -> &'static Encoding {