97 |
$self->{input_encoding} = lc $charset; ## TODO: normalize name |
$self->{input_encoding} = lc $charset; ## TODO: normalize name |
98 |
$self->{confident} = 1; |
$self->{confident} = 1; |
99 |
} else { |
} else { |
100 |
$charset = 'windows-1252'; ## TODO: for now. |
## TODO: Implement HTML5 detection algorithm |
101 |
|
require Whatpm::Charset::UniversalCharDet; |
102 |
|
$charset = Whatpm::Charset::UniversalCharDet->detect_byte_string |
103 |
|
(substr ($$bytes_s, 0, 1024)); |
104 |
|
$charset ||= 'windows-1252'; |
105 |
$s = \ (Encode::decode ($charset, $$bytes_s)); |
$s = \ (Encode::decode ($charset, $$bytes_s)); |
106 |
$self->{input_encoding} = $charset; |
$self->{input_encoding} = $charset; |
107 |
$self->{confident} = 0; |
$self->{confident} = 0; |