| 189 | } |
| 190 | |
| 191 | CharacterSet Content::guessEncoding() const |
| 192 | { |
| 193 | // assemble all blocks with unknown encoding |
| 194 | ByteArray input; |
| 195 | ForEachECIBlock([&](ECI eci, int begin, int end) { |
| 196 | if (eci == ECI::Unknown) |
| 197 | input.insert(input.end(), bytes.begin() + begin, bytes.begin() + end); |
| 198 | }); |
| 199 | |
| 200 | if (input.empty()) |
| 201 | return CharacterSet::Unknown; |
| 202 | |
| 203 | return TextDecoder::GuessEncoding(input.data(), input.size(), CharacterSet::ISO8859_1); |
| 204 | } |
| 205 | |
| 206 | ContentType Content::type() const |
| 207 | { |