Overflow release-notes.md is saved with latin1 encoding, corrupting non-ASCII characters (e.g. ⚠)

Open Beginner friendly
#2,953 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@jay23606 is already working on this.

Since Nov 6, 2026.

  • #2954 by @jay23606 — open
  • #2961 by @Shriraj1901 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github, node.js, typescript
Domain
backend, release

Research direction

Start in src/github.ts at GitHub.createFileOnNewBranch and inspect how file contents are encoded before being sent to GitHub. Reproduce the issue with the provided ⚠ example and check that the resulting bytes preserve UTF-8. Done when release notes retain non-ASCII characters; run the relevant tests for file creation if available.

Written by the indexing model from the issue text.

Description

priority: p3 type: bug
Environment details
  • OS: ubuntu-latest in GitHub Actions
  • Node.js version: the one bundled with googleapis/[email protected]
  • release-please version: 17.11.2
  • Manifest mode, 17 packages, one grouped release PR
What happens

When the release PR body is too large, release-please saves the full notes to release-notes.md on the release-please--branches--<branch>--release-notes branch. Any character above U+00FF in that file gets corrupted. For example, ### ⚠ BREAKING CHANGES is stored as ### \xA0 BREAKING CHANGES (a single 0xA0 byte, not valid UTF-8), and GitHub shows the file as ISO-8859 text.

That file is what release-please parses when the PR is merged, and it is what links in the PR body point to.

Real case: https://github.com/kc-workspace/kcws/pull/286 (notes branch commit feb7d78)

Root cause

GitHub.createFileOnNewBranch in src/github.ts:

// contents need to be base64 encoded
content: Buffer.from(contents, 'binary').toString('base64'),

The 'binary' (latin1) encoding keeps only the low byte of each UTF-16 code unit. ⚠ (U+26A0) becomes 0xA0, and emoji or CJK text in commit messages break the same way.

Steps to reproduce
const b = Buffer.from('### ⚠ BREAKING CHANGES', 'binary');
console.log(b.toString('hex').slice(0, 24)); // 23232320a020425245414b49
console.log(b.toString('utf8'));             // ### � BREAKING CHANGES
Suggested fix

Use Buffer.from(contents, 'utf8').toString('base64').

Dominant language
TypeScript
Stars
7.8k
Forks
621
Avg merge
1d 23h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/release-please

All issues in googleapis/release-please

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.