Skip to content

🎬 PowerShell script to convert .srt subtitle files from Windows-1250 to UTF-8 encoding, designed for ex-YU subtitles. Automatically creates .bak backups

License

Notifications You must be signed in to change notification settings

milos-p-lab/SRT-Win1250-UTF8-YU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎬 SRT Encoding Converter

License: MIT PowerShell

ℹ️ About

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


🌍 Opis na našem jeziku

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.


🚀 Features

  • 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.

⚙️ Usage

Run the script in PowerShell:

.\Convert-SrtEncoding.ps1 -Path "D:\Movies"

✅ How It Works

  • 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.
  • Prints a summary of converted files.

💡 Why Convert to UTF-8?

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.


🔧 Requirements

  • Windows PowerShell 5.1 or PowerShell Core (7.x)
  • No additional modules required

🤝 Contributing

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!

ℹ️ Note

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.


📜 License

MIT License – © 2025 Miloš Perunović

About

🎬 PowerShell script to convert .srt subtitle files from Windows-1250 to UTF-8 encoding, designed for ex-YU subtitles. Automatically creates .bak backups

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published