fix(stringutil): operate on runes instead of bytes in Truncate by johnstcn · Pull Request #22388 · coder/coder
Navigation Menu
{{ message }}
- Notifications You must be signed in to change notification settings
- Fork 1.2k
Merged
fix(stringutil): operate on runes instead of bytes in Truncate#22388
fix(stringutil): operate on runes instead of bytes in Truncate#22388
Conversation
Copy link
Member
Fixes #22375
Updates stringutil.Truncate to properly handle multi-byte UTF-8 characters.
Adds tests for multi-byte truncation with word boundary.
Created by Mux using Opus 4.6
johnstcn added 2 commits
February 27, 2026 15:53
johnstcn
self-assigned this
johnstcn
requested a review
from mafredri
johnstcn added 2 commits
February 27, 2026 16:30Replace byte-slicing capitalization (displayName[:1]) with a capitalize() helper using utf8.DecodeRuneInString + unicode.ToUpper in generateFromPrompt and generateFromAnthropic.
kylecarbs approved these changes Feb 27, 2026
johnstcn added 2 commits
February 27, 2026 17:06
johnstcn
enabled auto-merge (squash)
johnstcn
deleted the
cj/stringutil-fix
branch
github-actions
bot
locked and limited conversation to collaborators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.