[GH-ISSUE #7672] Command reader skips no-break spaces as whitespace; Brigadier's Character.isWhitespace does not #3325

Open
opened 2026-11-03 04:07:32 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @ClickingMaster on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7672

Originally assigned to: @razzo715 on GitHub.

🤖 Filed by ClickingMaster's AI agent (Claude Code, Claude Sonnet 5.5), not by ClickingMaster personally.

Reader::skip_whitespace (crates/horizon-command/src/lib.rs, ~line 143) uses Rust's char::is_whitespace. Brigadier's StringReader.skipWhitespace uses Character.isWhitespace. The two sets differ:

  • Rust treats U+00A0, U+2007, U+202F (no-break spaces) and U+0085 as whitespace; Java does not.
  • Java treats U+001C..U+001F as whitespace; Rust does not.

Expected (vanilla): @e[ name=x, distance=..5] fails with an expected-option error at the no-break space, and \u{1f} between selector options is skipped.
Actual: the no-break space is silently skipped and the selector parses; U+001F is rejected.

Fix: add a Java-compatible is_java_whitespace and use it in skip_whitespace.

Originally created by @ClickingMaster on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7672 Originally assigned to: @razzo715 on GitHub. > 🤖 Filed by ClickingMaster's AI agent (Claude Code, Claude Sonnet 5.5), not by ClickingMaster personally. `Reader::skip_whitespace` (crates/horizon-command/src/lib.rs, ~line 143) uses Rust's `char::is_whitespace`. Brigadier's `StringReader.skipWhitespace` uses `Character.isWhitespace`. The two sets differ: - Rust treats U+00A0, U+2007, U+202F (no-break spaces) and U+0085 as whitespace; Java does not. - Java treats U+001C..U+001F as whitespace; Rust does not. Expected (vanilla): `@e[ name=x, distance=..5]` fails with an expected-option error at the no-break space, and `\u{1f}` between selector options is skipped. Actual: the no-break space is silently skipped and the selector parses; U+001F is rejected. Fix: add a Java-compatible `is_java_whitespace` and use it in `skip_whitespace`.
Author
Owner

@ClickingMaster commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6586084261 --> @ClickingMaster commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: refused, You hold 8 open issues: finish or /unclaim one first. (asked by @ClickingMaster)

<!-- gh-comment-id:6586123976 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: refused, You hold 8 open issues: finish or `/unclaim` one first. (asked by @ClickingMaster)
Author
Owner

@ClickingMaster commented on GitHub (Nov 2, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6586143089 --> @ClickingMaster commented on GitHub (Nov 2, 2026): 🤖 Agent: /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: refused, You don't hold this issue. (asked by @ClickingMaster)

<!-- gh-comment-id:6586315376 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: refused, You don't hold this issue. (asked by @ClickingMaster)
Author
Owner

@razzo715 commented on GitHub (Nov 2, 2026):

/claim

<!-- gh-comment-id:6587829661 --> @razzo715 commented on GitHub (Nov 2, 2026): /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3325
No description provided.