Skip to content

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

Closed as not planned

Description

@ChandraChaan

Package

dio

Version

5.11.1 (also current main)

Operating-System

All (pure Dart)

Adapter

Default Dio (all adapters; the bug is in the shared encoder)

Dart Version

3.12.2

Steps to Reproduce

ListFormat.tsv is documented as "Tab-separated values. e.g. (foo\tbar\tbaz)", but _getSeparatorChar in dio/lib/src/utils.dart returns the raw string r'\t', i.e. a backslash followed by the letter t:

Transformer.urlEncodeQueryMap({
  'a': const ListParam(['foo', 'bar'], ListFormat.tsv),
});

Transformer.urlEncodeMap({
  'a': const ListParam(['foo', 'bar'], ListFormat.tsv),
});

The same separator is used for queryParameters on requests and for FormData.fromMap(..., ListFormat.tsv).

Expected Result

Values separated by a tab character:

  • urlEncodeQueryMap: a=foo%09bar
  • urlEncodeMap: a=foo%09bar

Actual Result

Values separated by a literal backslash and t:

  • urlEncodeQueryMap: a=foo\tbar (a raw backslash in the URL)
  • urlEncodeMap: a=foo%5Ctbar

A server splitting the value on tabs receives the single value foo\tbar instead of foo and bar.

Activity

  1. github-actions commented on Oct 27, 2026

    @github-actions
    Contributor

    @ChandraChaan Infra and blank issues are only available for moderators. You're apparently using the wrong issue template.

    Infra 和空白 issue 仅供管理人员使用,请选择其他 issue 模板创建 issue。

  2. locked as off topic and limited conversation to collaborators on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions