FB2 - Declared windows-1251 Encoding (Cyrillic)
A Cyrillic FictionBook stored in windows-1251 and declaring that encoding in its XML declaration - the single-byte legacy encoding a large share of real FB2 files still use. For testing importers that assume every XML file is UTF-8 and produce mojibake instead of an error.
<?xml version="1.0" encoding="windows-1251"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">
<description>
<title-info>
<genre>sci_philosophy</genre>
<author><first-name>Ilse</first-name><last-name>Brandt-Nakamura</last-name></author>
<book-title>��������� windows-1251</book-title>
<lang>ru</lang>
</title-info>
<document-info>
<author><nickname>novus</nickname></author>
<date value="2026-08-07">2026</date>
<id>novus-p7-fb2-cp1251</id>
<version>1.0</version>
</document-info>
</description>
<body>
<title><p>��������� windows-1251</p></title>
<section><title><p>����� ������</p></title><p>���� ���� �������� � ��������� windows-1251, ��� ������ ������ ����� FictionBook.</p><p>���������� XML �������� ���������, �� ����� �� UTF-8.</p></section>
<section><title><p>����� ������</p></title><p>���������, ������� ������ ���� ��� UTF-8, ������ ��������� �����.</p></section>
</body>
</FictionBook>
Specifications
- Seed
- 20260807
- Format
- FictionBook 2.0
- Encoding
- windows-1251
- Is Utf8
- false
- Declared In Xml Declaration
- true
- Script
- Cyrillic
- Sections
- 2
- Line Endings
- LF
Testing contract
Expected to pass- Scenario
- Parse the file with an XML parser and read the book title and chapter headings.
- Expected result
- The declared windows-1251 encoding is honoured and the Cyrillic text decodes correctly; reading the bytes as UTF-8 instead produces decode errors rather than silently-wrong text.
What is a .fb2 file?
FB2 (FictionBook) is an XML-based e-book format that stores an entire book, including metadata and embedded images, in a single well-structured XML file. It emphasizes semantic markup of book structure over fixed presentation. It is especially popular in the Russian-speaking e-book community.
How to use this file
Use an example FB2 to test XML e-book parsing, embedded-image extraction, metadata handling, and converters between FB2 and EPUB.
How to use this file for testing
“FB2 - Declared windows-1251 Encoding (Cyrillic)” is a deterministic Novus Examples fixture for Encoding detection, Conversion testing. UTF-8, UTF-8-BOM, UTF-16, and Latin-1 files with documented encodings and line endings for testing charset detection.
Documented properties for this file: seed 20260807 · windows-1251 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
E-book fixtures are structured archives documented down to their spine and manifest. Test readers and converters, and where a valid↔intentionally-invalid pair exists, assert graceful handling of the malformed container.
Related files
- emlEML — Base64: Accented UTF-8 BodyA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: From-Line and Lone DotA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: ISO-8859-1 BodyA base64 text/plain message in iso-8859-1 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: Soft Line BreaksA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: Trailing WhitespaceA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Quoted-Printable: Accented UTF-8 BodyA quoted-printable text/plain message in utf-8 whose body carries accented French text, guillemets, an em dash and a euro sign. It is the exact twin of the base64 message beside it: both decode to the same 247 octets, so a decoder can be diffed against a known-equal pair.

Generated by generation/ebooks_p7.py. Free for any use, no attribution required — license.