Skip to content

🐛 Fix ListFormat.tsv joining values with a literal \t - #2628

Open
ChandraChaan wants to merge 1 commit into
cfug:mainfrom
ChandraChaan:fix/2627-list-format-tsv
Open

ChandraChaan wants to merge 1 commit into
cfug:mainfrom
ChandraChaan:fix/2627-list-format-tsv

Conversation

@ChandraChaan

Copy link
Copy Markdown

New Pull Request Checklist

  • I have read the Documentation
  • I have read the Agent Contribution Guidelines (required if any part of the change was produced with AI assistance)
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary) (not applicable — the existing ListFormat.tsv doc already describes the fixed behavior)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

Closes #2627

ListFormat.tsv is documented as tab-separated, but _getSeparatorChar returned the raw string r'\t' (a backslash and a t), so values were joined with those two characters instead of a tab. In query strings this put a raw backslash into the URL (a=foo\tbar); in urlEncodeMap it became a=foo%5Ctbar.

The separator is now a real tab: %09 in query strings (matching how ssv already uses %20 there) and \t otherwise, which urlEncodeMap encodes to %09 and FormData keeps as a raw tab.

@AlexV525 calling this out because it changes request encoding on the wire for ListFormat.tsv users. Anyone currently relying on the literal \t would see real tabs instead, which is what the format is documented to produce.

The three existing tsv expectations in encoding_test.dart (urlEncodeMap tsv and custom, urlEncodeQueryMap custom) had captured the wrong output; they now expect %09 and fail without this change. dart test -p vm in dio/ passes (253 tests; the TLS-tagged tests are skipped by the default preset), and dart format and dart analyze --fatal-infos are clean.

Implementation and tests by Claude (Anthropic); reviewed by me before submitting.

`_getSeparatorChar` returned the raw string `r'\t'` (a backslash and a
`t`) instead of a tab, so tsv-formatted lists were never actually
tab-separated. Use `%09` in query strings, like `ssv` uses `%20`, and a
real tab otherwise.

Closes cfug#2627

Co-Authored-By: Claude <[email protected]>
@ChandraChaan
ChandraChaan requested a review from a team as a code owner October 27, 2026 16: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.

ListFormat.tsv joins values with a literal \t instead of a tab

1 participant