indexer: Improve charset detection + lower file cache time
This commit is contained in:
parent
7d2abfb3a4
commit
20141aa980
2 changed files with 7 additions and 3 deletions
|
|
@ -152,8 +152,12 @@ fn codec_from_path(path: &str) -> Option<EncodingRef> {
|
||||||
|
|
||||||
(_, Some("euckr")) => return Some(all::WINDOWS_949),
|
(_, Some("euckr")) => return Some(all::WINDOWS_949),
|
||||||
|
|
||||||
("ja", Some("jis7")) |
|
/* Not sure if PCK is just an alias for SJIS or if there's more of a difference, but it
|
||||||
("ja", Some("pck")) => return None, /* WAT? TODO: DO SOMETHING WITH THESE */
|
* 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)) => match encoding_from_whatwg_label(x) {
|
||||||
Some(x) => return Some(x),
|
Some(x) => return Some(x),
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use hyper;
|
||||||
|
|
||||||
|
|
||||||
const CACHE_PATH: &'static str = "/var/tmp/manned-indexer";
|
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> {
|
pub struct Path<'a> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue