Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 879 Bytes

detect_encoding.md

File metadata and controls

33 lines (24 loc) · 879 Bytes
unicons::detect_encoding

Header

#include <unicode_traits.hpp>

Synopsis

template <class InputIt>
detect_encoding_result<InputIt> detect_encoding(InputIt first, InputIt last) noexcept;

template <class Iterator>
struct detect_encoding_result
{
    Iterator pos;
    encoding ec;
};

Attempts to detect the character encoding from the first four bytes of the text.

Parameter Description
first, last Input iterators that demarcate the range of bytes. The byte type may be any integral type, signed or unsigned, with size in bits of 8.

Return value

Returns a value of type detect_encoding_result with pos pointing to one past the bom if present, otherwise to first, and a code that indicates the encoding.