Franklin M. Siler

Lawyer and Technologist

  • Home
  • Contact
  • Setup
  • Blog

Detecting character encodings

Posted in Uncategorized
November 11, 2021

This is a quick and dirty script inspired by this post, but it can definitely be a useful tool:

#!/usr/bin/env python
from chardet import detect
from sys import argv

for fn in argv[1:]:
  with open(fn, "rb") as f:
    print(fn, detect(f.read())['encoding'])
← No fault go-arounds
Handy commit hook →

Recent Posts

  • A tiny slice of e-tickets
  • I guess corporate America disappoints me at least once a month (or, “Krispy Kreme, what the heck?”)
  • The slightly infuriating process of signing up with Citi
  • Benchmarking for Local LLM
  • Changing your name for TSA Pre

Archives

  • October 2025
  • August 2025
  • July 2025
  • May 2025
  • January 2025
  • March 2024
  • November 2023
  • October 2023
  • April 2023
  • January 2023
  • October 2022
  • September 2022
  • July 2022
  • April 2022
  • November 2021
  • September 2021
  • June 2021
  • September 2019
  • August 2019
  • January 2019
  • August 2018
  • July 2018
  • June 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • August 2017
  • June 2017
  • August 2015
  • May 2015
  • October 2014
  • September 2014
  • December 2012
  • November 2012
  • September 2012

Categories

  • Agile
  • Computer Science
  • Copyright
  • Licensing
  • Security
  • Teaching
  • UBE and Reciprocity
  • Uncategorized
© Franklin M. Siler