See https://github.com/brianmario/charlock_holmes/issues/115 --- a/test/encoding_detector_test.rb +++ b/test/encoding_detector_test.rb @@ -24,7 +24,7 @@ assert detected_list.is_a? Array encoding_list = detected_list.map {|d| d[:encoding]}.sort - assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list + assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list end def test_class_level_detect_all_method_accepts_encoding_hint @@ -33,7 +33,7 @@ assert detected_list.is_a? Array encoding_list = detected_list.map {|d| d[:encoding]}.sort - assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list + assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list end def test_has_detect_method @@ -54,7 +54,7 @@ assert detected_list.is_a? Array encoding_list = detected_list.map {|d| d[:encoding]}.sort - assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list + assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list end def test_detect_all_accepts_encoding_hint @@ -63,7 +63,7 @@ assert detected_list.is_a? Array encoding_list = detected_list.map {|d| d[:encoding]}.sort - assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list + assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list end def test_strip_tags_flag --- a/test/string_methods_test.rb +++ b/test/string_methods_test.rb @@ -26,7 +26,7 @@ assert detected_list.is_a? Array encoding_list = detected_list.map {|d| d[:encoding]}.sort - assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list + assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list end def test_detect_encodings_accepts_encoding_hint_param @@ -37,7 +37,7 @@ assert detected_list.is_a? Array encoding_list = detected_list.map {|d| d[:encoding]}.sort - assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-8'], encoding_list + assert_equal ['ISO-8859-1', 'ISO-8859-2', 'UTF-16BE', 'UTF-16LE', 'UTF-8'], encoding_list end def test_returns_a_ruby_compatible_encoding_name