A PowerShell script that scans a folder (and subfolders) for .srt
subtitle files and converts them from Windows-1250 (Central European) encoding to UTF-8.
Automatically creates backup .bak
files before converting.
Ideal for fixing character encoding issues in media players like VLC, Plex, and Kodi.
✍️ Author: Miloš Perunović
🗓️ Date: 2025-07-16
PowerShell skripta koja pretražuje folder i podfoldere, pronalazi .srt
fajlove i automatski ih konvertuje iz Windows-1250 (često korišćen kod starijih titlova na ex-YU prostoru) u UTF-8. Ako je fajl već u UTF-8, skripta ga preskače.
Koristite ovu skriptu kako bi:
- riješili probleme sa prikazom slova (č, ć, š, ž, đ…)
- pripremili titlove za moderni softver i uređaje (Plex, Kodi, VLC…)
📝 Napomena: Ako imate titlove u drugim kodiranjima (npr. Windows-1252), prilagodite skriptu u skladu s tim.
- Automatically detects if
.srt
file is already UTF-8 encoded. - Converts all
.srt
files in a folder (including subfolders). - Helps avoid character encoding issues in media players.
- Ideal for subtitle collections in ex-YU languages.
Run the script in PowerShell:
.\Convert-SrtEncoding.ps1 -Path "D:\Movies"
- The script scans all
.srt
files under the specified folder. - Checks the current encoding of each file.
- If file is Windows-1250:
- Creates a backup of the original file with a
.bak
extension. - Converts the content to UTF-8.
- Overwrites the original
.srt
file.
- Creates a backup of the original file with a
- Prints a summary of converted files.
UTF-8:
- works everywhere (Windows, macOS, Linux)
- avoids garbled characters like Ä, æ, etc.
- is supported by modern media players like Plex, Kodi, VLC
Many older subtitles from ex-YU scene groups are still encoded in Windows-1250. Converting them to UTF-8 ensures correct display of all special characters.
- Windows PowerShell 5.1 or PowerShell Core (7.x)
- No additional modules required
Contributions, suggestions, and improvements are welcome!
- Open an Issue if you encounter bugs or have feature ideas.
- Create a Pull Request if you'd like to improve the script.
- Share feedback or examples of how you're using the script!
This script is tailored for Windows-1250 subtitles typical for ex-YU languages. If you have subtitles in other encodings (e.g. Windows-1252), adjust the script accordingly.
✅ Backup:
Before converting, the script automatically creates a.bak
backup for each.srt
file that needs conversion.
Keep or delete these backup files as needed once you verify your subtitles are working correctly.
MIT License – © 2025 Miloš Perunović