archive
/
md-pdf-rs
Archived
1
Fork 0

Force UTF-8 charset

This commit is contained in:
Jake Howard 2017-09-13 15:42:47 +01:00
parent 9290eed656
commit 7e52f03e53
Signed by: jake
GPG Key ID: 57AFB45680EDD477
1 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,5 @@
use html::{sciter_start, get_html, destroy_matching, destroy_at, get_head};
use sciter::Element;
use config::Config;
@ -9,5 +10,7 @@ pub fn head_cleanup(config: Config, input: String) -> Result<String, String> {
destroy_matching(&mut head, "meta[content='text/css']");
destroy_matching(&mut head, "style");
destroy_matching(&mut head, "title");
let mut meta_charset = Element::create_at("meta", &mut head).unwrap();
meta_charset.set_attribute("charset", "UTF-8");
return Ok(get_html(root));
}