Skip to content

fix: remove truncation of racks and moves in analysis output#459

Open
domino14 wants to merge 1 commit intomasterfrom
fix-issue-453-analysis-utf8
Open

fix: remove truncation of racks and moves in analysis output#459
domino14 wants to merge 1 commit intomasterfrom
fix-issue-453-analysis-utf8

Conversation

@domino14
Copy link
Owner

Fixes #453

Previously, the analysis output was truncating player names, racks, and move descriptions using byte-level string slicing (e.g., rack[:8]). This corrupted multi-byte UTF-8 characters like Polish diacritics (ą, ć, ę, ł, ń, ó, ś, ź, ż), causing invalid UTF-8 sequences to appear as � replacement characters.

Changes:

  • Removed truncation for racks (max 7 tiles, should always show in full)
  • Removed truncation for move descriptions (better to show full move)
  • Updated player name truncation to use rune-based slicing instead of byte-based to safely handle UTF-8 characters

The format strings (%-12s, %-8s, etc.) set minimum widths but don't truncate, so longer values will naturally use more space without corruption.

Fixes #453

Previously, the analysis output was truncating player names, racks, and move
descriptions using byte-level string slicing (e.g., rack[:8]). This corrupted
multi-byte UTF-8 characters like Polish diacritics (ą, ć, ę, ł, ń, ó, ś, ź, ż),
causing invalid UTF-8 sequences to appear as � replacement characters.

Changes:
- Removed truncation for racks (max 7 tiles, should always show in full)
- Removed truncation for move descriptions (better to show full move)
- Updated player name truncation to use rune-based slicing instead of byte-based
  to safely handle UTF-8 characters

The format strings (%-12s, %-8s, etc.) set minimum widths but don't truncate,
so longer values will naturally use more space without corruption.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

Rendering bug in analyzer with Polish characters

1 participant