indexer: Improve charset detection + lower file cache time

This commit is contained in:
Yorhel 2016-11-09 18:41:53 +01:00
parent 7d2abfb3a4
commit 20141aa980
2 changed files with 7 additions and 3 deletions

View file

@ -152,8 +152,12 @@ fn codec_from_path(path: &str) -> Option<EncodingRef> {
(_, Some("euckr")) => return Some(all::WINDOWS_949),
("ja", Some("jis7")) |
("ja", Some("pck")) => return None, /* WAT? TODO: DO SOMETHING WITH THESE */
/* Not sure if PCK is just an alias for SJIS or if there's more of a difference, but it
* certainly looks like a SJIS-like encoding. */
("ja", Some("pck")) => return Some(all::WINDOWS_31J),
/* This is apparently some variant of ISO-2022-JP */
("ja", Some("jis7")) => return Some(all::ISO_2022_JP),
(_, Some(x)) => match encoding_from_whatwg_label(x) {
Some(x) => return Some(x),

View file

@ -7,7 +7,7 @@ use hyper;
const CACHE_PATH: &'static str = "/var/tmp/manned-indexer";
const CACHE_TIME: u64 = 24*3600;
const CACHE_TIME: u64 = 23*3600;
pub struct Path<'a> {