Skip to content

Generate en_US.UTF-8 locale in Ruby base image#6

Merged
baelter merged 1 commit intomainfrom
install-en-us-locale
Apr 14, 2026
Merged

Generate en_US.UTF-8 locale in Ruby base image#6
baelter merged 1 commit intomainfrom
install-en-us-locale

Conversation

@baelter
Copy link
Copy Markdown
Member

@baelter baelter commented Apr 14, 2026

Summary

  • Installs locales package and generates en_US.UTF-8
  • Heroku apps migrated from slug to container deploys carry a LANG=en_US.UTF-8 config var that points to a locale not present on Debian slim
  • Ruby silently falls back to US-ASCII encoding, breaking any code that reads files with non-ASCII bytes (Sass, ERB, etc.)
  • With the locale installed, both LANG=C.UTF-8 and LANG=en_US.UTF-8 work correctly

Test plan

  • Built image locally, verified locale -a includes en_US.utf8
  • Verified LANG=en_US.UTF-8 ruby -e "puts Encoding.default_external" prints UTF-8

Heroku apps migrated from slug to container deploys carry a
LANG=en_US.UTF-8 config var. On Debian slim this locale doesn't
exist, causing Ruby to silently fall back to US-ASCII encoding.
@baelter baelter requested a review from walro April 14, 2026 07:35
@baelter baelter merged commit e84a921 into main Apr 14, 2026
7 checks passed
@baelter baelter deleted the install-en-us-locale branch April 14, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants