Skip to content

Read the Pagefind entry as UTF-8 - #3992

Merged
hsbt merged 1 commit into
masterfrom
claude/cloudflare-error-pr-3989-a9b7cf
Jul 28, 2026
Merged

Read the Pagefind entry as UTF-8#3992
hsbt merged 1 commit into
masterfrom
claude/cloudflare-error-pr-3989-a9b7cf

Conversation

@hsbt

@hsbt hsbt commented Jul 28, 2026

Copy link
Copy Markdown
Member

Cloudflare Pages has failed every build since #3989 merged.

/opt/buildhome/repo/lib/search_index.rb:90:in `read_entry'
"\xE2" on US-ASCII (Encoding::InvalidByteSequenceError)

Pagefind lists the word characters it splits on in include_characters, so pagefind-entry.json reaches past ASCII. read_entry used a bare File.read, which tags the string with Encoding.default_external. Cloudflare's build container leaves the locale at POSIX, so that is US-ASCII and JSON.parse raises as it converts the source to UTF-8. GitHub Actions sets a UTF-8 locale, which is why CI stayed green.

The fixture now carries include_characters the way Pagefind writes it, and one case runs apply_fallbacks under a US-ASCII Encoding.default_external.

Pagefind lists the word characters it splits on in `include_characters`,
and they reach past ASCII. On a build host that leaves the locale at
POSIX, Cloudflare Pages among them, `File.read` hands back a US-ASCII
string and the build dies in `JSON.parse` on the first of those bytes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hsbt
hsbt requested a review from a team as a code owner July 28, 2026 03:56
@hsbt
hsbt merged commit ca263a6 into master Jul 28, 2026
3 checks passed
@hsbt
hsbt deleted the claude/cloudflare-error-pr-3989-a9b7cf branch July 28, 2026 04:01
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