Fixing a Subtitle Bug Caused by Byte Order Marks in Python
Fixing a bug with byte order marks
While converting SRT subtitles to WebVTT, I discovered a bug where byte order marks disrupted the file format. My initial manual fix was messy, but using Python's utf-8-sig encoding provided an elegant solution. I then used ripgrep to find and clean up dozens of previously corrupted files in my media library.
This sort of lesson is exactly why I love managing my local media archives as hand-built static websites – the lo-fi approach gives me lots of opportunities to explore low-level ideas and learn how things actually work on my computer.