@@ -46,7 +46,7 @@ all() ->
4646 [doctests ,
4747 {group , cpd_tests }, xpath_text1 , xpath_main ,
4848 xpath_abbreviated_syntax , xpath_functions , xpath_relational ,
49- xpath_namespaces ,
49+ xpath_namespaces , ucs_is_incharset ,
5050 {group , misc }, {group , eventp_tests },
5151 {group , ticket_tests }, {group , app_test },
5252 {group , appup_test }, {group , format_test }].
@@ -678,6 +678,16 @@ allow_entities_test(Config) ->
678678 (catch xmerl_scan :file (File , [{allow_entities , false }])),
679679 ok .
680680
681+ % % Regression: xmerl_ucs:is_incharset/2 crashed with a case_clause on a
682+ % % multi-character list for charsets handled via to_unicode/2 (e.g. utf-8),
683+ % % because the clause only matched a single-element result.
684+ ucs_is_incharset (_Config ) ->
685+ true = xmerl_ucs :is_incharset (" abc" , 'utf-8' ),
686+ true = xmerl_ucs :is_incharset (" a" , 'utf-8' ),
687+ true = xmerl_ucs :is_incharset (" abc" , 'iso-8859-1' ),
688+ false = xmerl_ucs :is_incharset ([256 , 257 ], 'iso-8859-1' ),
689+ ok .
690+
681691% %======================================================================
682692% % Support Functions
683693% %======================================================================
0 commit comments