Skip to content

fix: build as UTF-8 without a UTF-8 locale (Cloudflare Pages) - #35

Merged
matbrgz merged 1 commit into
masterfrom
fix/build-utf8
Oct 11, 2026
Merged

matbrgz merged 1 commit into
masterfrom
fix/build-utf8

Conversation

@matbrgz

@matbrgz matbrgz commented Oct 11, 2026

Copy link
Copy Markdown
Member

The Cloudflare Pages production build of #34 failed: kramdown … The source text contains invalid characters for the used encoding US-ASCII.

The build image cannot set en_US.UTF-8, so Ruby reads files as US-ASCII. encoding: UTF-8 in _config.yml covers pages but not _data YAML, and kramdown fails on the accented pt-BR resources.

_plugins/000_utf8_encoding.rb sets Ruby's default external and internal encodings to UTF-8. Plugins load before the site is read, so this covers data files too. The Cloudflare Pages preview build on this PR is the check.

🤖 Generated with Claude Code

Cloudflare Pages builds cannot set en_US.UTF-8, so Ruby defaulted to
US-ASCII. `encoding:` in _config.yml covers pages only; _data YAML is read
with Ruby's default, and kramdown failed on the accented pt-BR resources
added in #34 ("The source text contains invalid characters for the used
encoding US-ASCII"). Plugins load before the site is read, so setting the
default encodings there fixes every file.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying iplibrary-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: b0e9b4e
Status: ✅  Deploy successful!
Preview URL: https://28f49b33.iplibrary-website.pages.dev
Branch Preview URL: https://fix-build-utf8.iplibrary-website.pages.dev

View logs

@matbrgz
matbrgz merged commit 5d174bb into master Oct 11, 2026
10 of 13 checks passed
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.

1 participant