Encoding and XML Preservation - KevinK56/MetadataEditor GitHub Wiki
One of the biggest frustrations with generic text editors or basic NFO tools is that they either strip out unrecognized XML tags (destroying stream details, unique IDs, or custom scraper fields) or corrupt DOS ASCII art by saving CP437 files as UTF-8.
Metadata Editor is engineered from the ground up for 100% lossless XML round-tripping and accurate character encoding detection.
Media servers and metadata managers (Kodi, Emby, Jellyfin, Radarr, Sonarr, TinyMediaManager) frequently store specialized XML blocks inside .nfo files that go beyond standard fields like <title> or <plot>.
Examples include:
-
<fileinfo>and<streamdetails>(video codech264/hevc, resolution1920x1080, audio channels, subtitle languages) <uniqueid type="tmdb" default="true">10160</uniqueid><uniqueid type="imdb">tt0097981</uniqueid><thumb aspect="poster">poster.jpg</thumb><fanart><thumb>fanart.jpg</thumb></fanart>-
<lockdata>false</lockdata>,<dateadded>,<criticrating>,<resume>,<userstate>
- When loading an XML NFO file, Metadata Editor maps standard fields into the visual form cards (
Primary Information,Story, Plot & Overview,Genres & Production Details,Cast & Characters,Online IDs & Web Links). - Any other XML element—including complex nested XML blocks (
<fileinfo>...</fileinfo>) and elements carrying XML attributes (<uniqueid type="tmdb" default="true">,<thumb aspect="poster">)—is automatically captured in theCustom & Extra XML Tagstable at the bottom of the 📋 Metadata Form tab. - You can view, edit, add (
➕ Add Custom Tag), or remove (✕) these extra nodes directly in the form, or edit them in the 📝 Raw Text / XML Editor tab. - When you save (
Ctrl + S) or switch between the Visual Form and Raw XML tabs, every single custom tag, attribute, and nested element is serialized back into the XML cleanly without any data loss.
.nfo files in the wild use several incompatible character encodings depending on whether they were created by modern media servers (UTF-8) or classic scene release groups (DOS CP437).
Metadata Editor inspects the Byte Order Mark (BOM) and performs heuristic byte-stream validation on every file you open:
| Encoding Option | Detection & Use Case |
|---|---|
UTF-8 (Standard) |
Default for Kodi, Jellyfin, Emby, and modern XML scrapers (no BOM). |
UTF-8 with BOM |
UTF-8 prefixed with 0xEF 0xBB 0xBF for legacy Windows tool compatibility. |
CP437 (DOS / Scene ASCII) |
Original IBM PC / MS-DOS encoding used by scene release .nfo files for box-drawing (╔═╗), block shading (█▓▒░), and logos. Automatically selected when high-ASCII non-UTF-8 byte sequences are detected. |
Windows-1252 (ANSI) |
Western European legacy Windows ANSI encoding. |
UTF-16 LE (Unicode) |
16-bit Little-Endian Unicode (0xFF 0xFE BOM). |
To convert a file from one encoding to another:
- Open the file in Metadata Editor.
- Use the Encoding: dropdown in the top toolbar to select your target encoding (e.g.,
UTF-8 (Standard)). - Press
Ctrl + Sto save the file in the newly selected encoding.