The u8xml package NewDecoder can be used to parse XML files with IANA character encodings instead of Go Standard Library xml package Decoder.
u8hex CLI utility
The cmd folder contains the source code of the u8hex command-line interface utility, which may be used to get the hex representation of a string with a given character set. It may be useful for debugging.
Copyright 2024 Serguei Vine. All rights reserved.
Use of this source code is governed by a MIT-style
license that can be found in the LICENSE file.
The u8xml package implements NewDecoder which can be used to parse
XML files with IANA character encodings such as Windows-1252, ISO-8859-1, unicode,etc.
It can be used to decode XML files/strings with Go Standard Library xml package
Decoder type methods like Decode(), Token(), etc.
XML files must contain a BOM at the beginning in the case of unicode characters or
an XML declaration with an encoding attribute otherwise.
XML files with UTF-8 content may be detected either by BOM or XML declaration.
XML files with no BOM or XML declaration will be treated as UTF-8.