#ifndef ENCODING_DETECTOR_HPP #define ENCODING_DETECTOR_HPP #include #include #include namespace beresta::encoding { // Результат автоопределения: имя кодировки и длина BOM, который нужно пропустить // The detection result: the encoding name and the length of the BOM to skip struct DetectedEncoding { std::string name; std::size_t bomLength; }; /* ** Определение кодировки по правилам приложения F спецификации XML: ** 1) BOM: EF BB BF (UTF-8), FF FE (UTF-16LE), FE FF (UTF-16BE); ** 2) без BOM — по первым байтам "