pickup
pickup copied to clipboard
Autodetection of Character Encodings
In the common use case, streaming a feed over HTTP, we receive the encoding via the Content-Type HTTP header and pass it to our constructor.
But what if we we don't know the encoding upfront? In this case the parser has to use the BOM, so it can reliably read the encoding tag. If no BOM is available use ASCII to read the tag. If this fails, assume UTF-8.
https://www.w3.org/TR/REC-xml/#sec-guessing