Skip to content

Commit 9fe77ed

Browse files
committed
improve wording
1 parent 0218948 commit 9fe77ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/html.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ impl<'x> Html<'x> {
1414
pub(crate) fn new(html: Cow<'x, str>) -> Html<'x> {
1515
Html(html)
1616
}
17-
/// Access the raw html with a potentially wrong charset.
17+
/// Access the raw html with the original charset.
1818
///
19-
/// `mail-parser` only returns utf-8 strings, so the only sensible charset for the html is utf-8. Because html can declare its charset in `<meta>` tags, in the process of transcoding to utf-8 these may be incorrect.
20-
/// Call [`Html::strip_charset`] before this method if the html will be given to a standard-conforming browser.
19+
/// `mail-parser` returns utf-8 strings, so the only correct charset for the html is utf-8. Because html can declare its charset in `<meta>` tags, in the process of transcoding these may become incorrect.
20+
/// If the correct charset is needed [`Html::strip_charset`] must be called before accessing the html with this method.
2121
pub fn potentially_wrong_charset(&self) -> &Cow<'x, str> {
2222
&self.0
2323
}
2424
/// Strip charset from html, making it utf-8 by default.
2525
///
26-
/// Call this method if the result is given to a standard-conforming browser.
26+
/// This method should be called if the consumer of the html is a standard-conforming browser.
2727
pub fn strip_charset(&mut self) {
2828
let mut off = 0;
2929
let mut first = true;

0 commit comments

Comments
 (0)