[totem-pl-parser/wip/hadess/more-encoding: 3/6] plparser: Ignore case for UTF-8 encoding check in XML documents




commit d7e724a409b0df09bf7d677169af898aa98e6d9f
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", as encodings aren't
    case sensitive.
    
    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 1918360..a1bec2b 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1874,7 +1874,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)
                return doc;
 
        xml_parser_free_tree (doc);


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