• Show log

    Commit

  • Hash : 46f05ea4
    Author : Nick Wellnhofer
    Date : 2025-05-09T00:21:47

    html: Rework meta charset handling
    
    Don't use encoding from meta tags when serializing. Only use the value
    in `doc->encoding`, matching the XML serializer. This is the actual
    encoding used when parsing.
    
    Stop modifying the input document by setting meta tags before
    serializing. Meta tags are now injected during serialization.
    
    Add full support for <meta charset=""> which is also used when adding
    meta tags.
    
    Align with HTML5 and implement the "algorithm for extracting a character
    encoding from a meta element". Only modify the encoding substring in
    Content-Type meta tags.
    
    Only switch encoding once when parsing.
    
    Fix htmlSaveFileFormat with a NULL encoding not to declare a misleading
    UTF-8 charset.
    
    Fixes #909.