Skip to content

Recognize vertical tab and form feed as ASCII whitespace #591

Closed

Description

@LunaStev

std::string::ascii::is_space recognizes space (0x20), tab (0x09), LF (0x0A), and CR (0x0D), but omits vertical tab (0x0B) and form feed (0x0C).

The trimming helpers in std/string/trim.wave duplicate the same four-byte set, so both APIs leave two standard ASCII whitespace characters untreated.

This makes the public ASCII classification helper incomplete and means strings beginning or ending with VT/FF are not trimmed consistently with the full ASCII whitespace set.

Code evidence:

  • std/string/ascii.wave — is_space
  • std/string/trim.wave — trim_left_index / trim_right_index

Cases to cover:

  • is_space(11) should classify vertical tab as whitespace.
  • is_space(12) should classify form feed as whitespace.
  • Left/right trimming should treat the same six ASCII whitespace bytes consistently.
  • Existing behavior for ordinary spaces, tabs, LF, and CR must remain unchanged.

Acceptance:

  • Complete the ASCII whitespace classification with VT and FF.
  • Keep the trim helpers consistent with is_space rather than maintaining a divergent set.
  • Add regression coverage for all six ASCII whitespace characters and at least one non-whitespace control byte.
  • Keep the change dependency-free and portable across targets.

Activity

  1. added
    bug
    good first issue
    on Sep 12, 2026
  2. nightcityblade commented on Sep 12, 2026

    @nightcityblade
    Contributor

    Hi, I'd like to work on this. I'll submit a PR shortly.

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

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions