[totem-pl-parser] plparser: Ignore case for UTF-8 encoding check in XML documents



commit de23ed726be65424c05d18c2fba3054b68bb8666
Author: crvi <crvisqr gmail com>
Date:   Thu Mar 4 16:54:46 2021 +0530

    plparser: Ignore case for UTF-8 encoding check in XML documents
    
    Don't try to convert from "utf-8" to "UTF-8" encodings, as those are one
    and the same, and iconv will fail when trying that.
    
    Encodings are defined in:
    https://www.iana.org/assignments/character-sets/character-sets.xhtml

 plparse/totem-pl-parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index e4db129..bffc89a 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1872,7 +1872,7 @@ totem_pl_parser_parse_xml_relaxed (char *contents,
                break;
        }
 
-       if (encoding == NULL || g_str_equal (encoding, "UTF-8") != FALSE) {
+       if (encoding == NULL || g_ascii_strcasecmp (encoding, "UTF-8") == 0) {
                g_free (encoding);
                return doc;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]