Nástroj k opravě titulků a převádění nechutného českého charsetu na UTF-8 — teď s GUI a náhledem.
před: Pane, jsem teï zaneprázdnìný.
po: Pane, jsem teď zaneprázdněný.
Přetáhnete titulky (.srt, .sub, .ass, .vtt …) nebo celé složky do fronty, titulkovač u každého souboru
pozná kódování (Windows-1250, ISO 8859-2, CP852 z DOSu, Mac CE, UTF-8 s BOM i bez), opraví rozbité znaky
(„mojibake“ — soubor, který někdo uložil přes špatnou kódovou stránku, např. teï místo teď, Øekni místo Řekni)
a uloží ho jako čisté UTF-8. V náhledu vidíte před → po s vyznačenými změnami ještě před tím, než se cokoliv
přepíše; originál zůstane jako .bak (nebo se zapíše vedle / do podsložky).
- časování a čísla titulků se nikdy nemění, jen text
- umí i slovenštinu, polštinu a maďarštinu
- cílové kódování může být i Windows-1250 / ISO 8859-2 / CP852 pro staré televize a přehrávače, volitelně BOM a CRLF
- soubory, které jsou už v pořádku, nechá být
- presety (UTF-8 přepsat se zálohou / UTF-8 vedle originálu / Windows-1250 + CRLF pro staré TV) + vlastní
Stáhněte hotovou aplikaci z posledního vydání (Windows / Linux / macOS, není potřeba Python), nebo ze zdrojáku:
pip install -r requirements.txt
python main.py # GUI (run.cmd / run.sh)
python titulkovac.py # CLI – opraví titulky v aktuální složce jako dřív
python titulkovac.py film.srt serial/ # UTF-8, přepíše, nechá .bak
python titulkovac.py . --to cp1250 --folder tv # pro starou televizi do podsložky tv
python titulkovac.py . -n # jen ukázat, co by se detekovalo
python titulkovac.py . --from cp852 --no-repair # vynutit zdrojové kódování
Fixes subtitle files with a broken Central-European charset and saves them as UTF-8 — with a GUI that shows a before → after preview with changed characters highlighted before anything is written.
- The bytes are decoded with every plausible encoding: UTF-8 (with/without BOM) first, then Windows-1250, ISO 8859-2, CP852, Mac CE, Windows-1252, Latin-1, UTF-16.
- For every decoded text titulkovač also tries to undo mojibake — text that was once decoded with the wrong code page (Latin-1 / Windows-1252 / Windows-1250 / CP437 …) and re-saved as UTF-8 — by re-encoding it with the wrong page and decoding with the right one.
- Every candidate is scored: Czech / Slovak / Polish / Hungarian letters and common words count up; western letters in the wrong places, control characters, box-drawing and other symbols that never occur in subtitles count down. The best candidate wins; on a tie the simplest explanation (plain UTF-8, no repair) is preferred. The Confidence column shows how far ahead the winner is.
- Only the text changes — timing lines and cue numbers pass through untouched. Output can be UTF-8 (optional BOM),
Windows-1250, ISO 8859-2 or CP852, with the original line endings or forced CRLF / LF; the original is kept as
.bakwhen overwriting, or the result goes next to the file with a suffix / into a subfolder.
The old 2022 scripts replaced a hard-coded list of 18 characters after reading every file as Windows-1250; they
silently corrupted files that were already UTF-8 or ISO 8859-2 and could not handle ť, ľ or anything outside
the list. The new engine is generic, tested (tests/) and exposed both in the GUI and the CLI.
Prebuilt binaries for Windows, Linux and macOS are on the releases page;
from source: pip install -r requirements.txt, then python main.py (GUI) or python titulkovac.py --help (CLI).
pip install -r requirements.txt pyinstaller pytest && python -m pytest tests && python build.py →
dist/titulkovac-<version>-<os>-<arch>. The GitHub workflow runs the tests, builds all three platforms on every tag
and attaches them to the release; the Linux build also runs a headless self-test on generated broken samples
(TITULKOVAC_SELFTEST=<folder>).
- The Windows taskbar shows the app's own icon. The taskbar button takes its icon from the process's Application User Model ID rather than from the window, and with none of its own the process was grouped under whatever launched it and wore that program's icon. One is now set before any window exists, and it carries no version number so a pinned button survives an upgrade.
- helper processes (e.g. the file manager opened by "Show in folder") are tracked and killed when the app quits or crashes
- no partial output files: subtitles, backups and presets are written to a temp name and moved into place only when complete
- adding files or folders rejects paths already in the queue ("n already in queue" in the status bar)
- folders are scanned in natural order (
Episode 9beforeEpisode 10)
- PySide6 GUI: drag & drop queue with detected encoding / confidence / action, before → after preview with highlighted changes, progress, log, presets
- real encoding detection and mojibake repair instead of a fixed replacement table; Slovak / Polish / Hungarian too
- output encodings, BOM, line endings, overwrite-with-backup / suffix / subfolder modes
- CLI with dry run;
titulkovac-turbo.pyfolded intotitulkovac.py - tests, PyInstaller build, CI releases for Windows / Linux / macOS, MIT license
tags: opravit titulky, oprava titulků, jak opravit titulky, divné znaky, kódování titulků, utf-8, ISO 8859-2, Windows-1250, latin-1, mojibake, fix subtitle encoding, czech subtitles