Skip to content

fix(string): Fix character length limit and unnecessary allocation in AsciiString::toLower(); add AsciiString::toUpper() - #3020

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
xezon:xezon/fix-asciistring-toupper
Jul 28, 2026
Merged

fix(string): Fix character length limit and unnecessary allocation in AsciiString::toLower(); add AsciiString::toUpper()#3020
xezon merged 2 commits into
TheSuperHackers:mainfrom
xezon:xezon/fix-asciistring-toupper

Conversation

@xezon

@xezon xezon commented Jul 27, 2026

Copy link
Copy Markdown

Merge with Rebase

This change fixes the character length limit (MAX_FORMAT_BUF_LEN) and unnecessary allocation (when string was already lower) in AsciiString::toLower() and implements a AsciiString::toUpper() as well.

UnicodeString does not have a toLower function.

TODO

  • Add pull id to commits

@xezon xezon added System Is Systems related Fix Is fixing something, but is not user facing labels Jul 27, 2026
@xezon
xezon force-pushed the xezon/fix-asciistring-toupper branch from 81bdac7 to b5f57c0 Compare July 27, 2026 20:40
@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

Updates AsciiString case conversion to operate in place without a fixed-length temporary buffer and adds the corresponding uppercase API.

  • Reworks toLower() to avoid allocation when conversion is unnecessary.
  • Adds toUpper() with equivalent copy-on-write behavior.
  • Casts bytes to unsigned char before every ctype call, resolving the previously reported invalid-input-domain issue.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
Core/GameEngine/Include/Common/AsciiString.h Declares the new AsciiString::toUpper() API.
Core/GameEngine/Source/Common/System/AsciiString.cpp Implements allocation-aware in-place case conversion and safely supplies unsigned-byte values to ctype functions.

Reviews (2): Last reviewed commit: "chore(string): Implement AsciiString::to..." | Re-trigger Greptile

Comment thread Core/GameEngine/Source/Common/System/AsciiString.cpp Outdated
@xezon
xezon force-pushed the xezon/fix-asciistring-toupper branch from b5f57c0 to 58c79c8 Compare July 27, 2026 20:46

@Skyaero42 Skyaero42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Comment thread Core/GameEngine/Source/Common/System/AsciiString.cpp
@xezon
xezon merged commit e760b36 into TheSuperHackers:main Jul 28, 2026
17 checks passed
xezon added a commit that referenced this pull request Jul 28, 2026
@xezon
xezon deleted the xezon/fix-asciistring-toupper branch July 28, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Is fixing something, but is not user facing System Is Systems related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants