Fix comment about CRLF normalization
This commit is contained in:
parent
a4827e5344
commit
276aa84cf5
1 changed files with 4 additions and 4 deletions
|
|
@ -39,11 +39,11 @@ impl ToString for MimeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Normalize \r and \r\n into \n.
|
/// Normalize CR and CRLF into LF.
|
||||||
///
|
///
|
||||||
/// Gtk does this for text/plain;charset=utf-8, so following them here, otherwise there is
|
/// 'text' mime types require CRLF line ending according to
|
||||||
/// a chance of getting extra new lines on load, since they're converting \r and \n into
|
/// RFC-2046, however the platform line terminator and what applications
|
||||||
/// \r\n on every store.
|
/// expect is LF.
|
||||||
pub fn normilize_to_lf(text: String) -> String {
|
pub fn normilize_to_lf(text: String) -> String {
|
||||||
text.replace("\r\n", "\n").replace("\r", "\n")
|
text.replace("\r\n", "\n").replace("\r", "\n")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue