mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04:00
Reset iconv_cp when switching from Big5 -> UTF-8 to UTF-8 -> UTF-8.
After viewing a page with Big5 charset and next a page with UTF-8 charset iconv was used, so slows down a bit. Now iconv is used only for those charsets, which has the iconv bitfield set.
This commit is contained in:
parent
6d567bb8ce
commit
90b37ff15f
@ -985,16 +985,20 @@ get_translation_table(int from, int to)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (codepages[from].iconv) {
|
if (codepages[from].iconv) {
|
||||||
struct conv_table *table = get_translation_table_to_utf8(34);
|
struct conv_table *table2 = get_translation_table_to_utf8(34);
|
||||||
|
|
||||||
if (table) table->iconv_cp = from;
|
if (table2) table2->iconv_cp = from;
|
||||||
return table;
|
return table2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/*from == to ||*/ from == -1 || to == -1)
|
if (/*from == to ||*/ from == -1 || to == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (is_cp_ptr_utf8(&codepages[to]))
|
if (is_cp_ptr_utf8(&codepages[to])) {
|
||||||
return get_translation_table_to_utf8(from);
|
struct conv_table *table2 = get_translation_table_to_utf8(from);
|
||||||
|
|
||||||
|
if (table2) table2->iconv_cp = -1;
|
||||||
|
return table2;
|
||||||
|
}
|
||||||
if (from == lfr && to == lto)
|
if (from == lfr && to == lto)
|
||||||
return table;
|
return table;
|
||||||
lfr = from;
|
lfr = from;
|
||||||
|
Loading…
Reference in New Issue
Block a user