A copied Chinese slug can turn into a broken link when a supplier encodes the full URL as though it were one parameter. Agree which values are path segments and which are query values. Keep the URL structure intact and test characters that can otherwise act as separators.
Who should use this acceptance brief
Businesses commissioning multilingual resource URLs. Use this as a scoped website handover task. Where real system evidence is required, teaching examples are not a substitute.
Source-bound platform fact
encodeURIComponent encodes an individual URI component, including characters that can have separator meaning. It is not a function to apply blindly to a complete URL. MDN: encodeURIComponent · Checked 16 October 2026.
Filled teaching example
Synthetic example, not a client case. Finite inputs, expected decisions and counterexamples follow; no live integration is claimed.
On narrow screens, scroll to read the complete table.
| Input / case | Check basis | Expected decision |
|---|---|---|
| segment=报价 | component encoding | %E6%8A%A5%E4%BB%B7 |
| segment=A/B | slash part of value | A%2FB |
| already encoded value | risk double encoding | agree input contract |
Run the acceptance exercise
- Specify whether the application receives raw Unicode segments or an already-encoded path.
- Construct a test URL from an approved base and individually encoded values.
- Follow the actual new route and verify canonical, decoded identity and round-trip links.
Interpret the result and retain evidence
The fixture encodes only raw segments and returns their strings; it does not fetch a route or prove every server accepts an encoded slash. If a slash is not allowed in a business slug, reject it under that policy rather than assuming encoding makes it supported. Preserve the raw/encoded boundary in the handover.
Limits before implementation
No old slugs, canonicals or redirects are changed. Excludes arbitrary URL validation and server-specific routing support.
Replay the finite example
Save both files in one folder and run with Node22.13 or newer. The example sends no network requests and changes no account or site. Filled inputs and expected outputs · Inspectable functions
node decision-check.mjs bilingual-url-segment-encoding.json