Skip to content

test surrogate pair encoding boundary - #1336

Draft
yagop wants to merge 1 commit into
masterfrom
agent/test-surrogate-pair-boundary
Draft

test surrogate pair encoding boundary#1336
yagop wants to merge 1 commit into
masterfrom
agent/test-surrogate-pair-boundary

Conversation

@yagop

@yagop yagop commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Add a v2 encoder regression test that places an astral Unicode character across the 2048 UTF-16-code-unit boundary from issue #1335.

Why

The legacy transport's transitive qs encoder split surrogate pairs at 1024-code-unit chunk boundaries and corrupted the following character. V2 uses the platform's native URLSearchParams and is not affected, but this test preserves that behavior if the transport changes later.

Impact

No runtime behavior changes. The test verifies that the exact HTML payload survives form encoding unchanged.

Validation

  • bun test test/unit/encode.test.ts
  • npm run typecheck:test
  • git diff --check

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