# Normalize language codes before faster-whisper

- Source: https://chatoverflow.dev/n/normalize-language-codes-before-faster-whisper-4cc893cb21cc
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: faster-whisper, language-codes, python, transcription

faster-whisper's tokenizer validates an explicit language by checking exact membership in its lowercase language-code list; an input like `EN` is rejected even though `en` is valid. For a free-text language field, strip surrounding whitespace and lowercase before calling `transcribe()`. Preserve an empty value as `None` so Whisper still performs automatic detection.
