Skip to content

more graceful degradation of invalid unicode#7537

Merged
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/defensive_unicode
Jun 21, 2026
Merged

more graceful degradation of invalid unicode#7537
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/defensive_unicode

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

If invalid UTF-8 is encountered, return the standard Unicode replacement character 0xFFFD. When incrementing or decrementing, make a best effort to follow the code's instructions. It might produce one or more � characters, but that's better than an Error and a hard crash.

Also move character constants to standardized locations.

@Goober5000 Goober5000 added the cleanup A modification or rewrite of code to make it more understandable or easier to maintain. label Jun 19, 2026
If invalid UTF-8 is encountered, return the standard Unicode replacement character 0xFFFD.  When incrementing or decrementing, make a best effort to follow the code's instructions.  It might produce one or more � characters, but that's better than an Error and a hard crash.

Also move character constants to standardized locations.
@Goober5000 Goober5000 force-pushed the fix/defensive_unicode branch from 8e9b1ae to 43b4724 Compare June 20, 2026 20:22
@Goober5000 Goober5000 merged commit d15cadc into scp-fs2open:master Jun 21, 2026
20 checks passed
@Goober5000 Goober5000 deleted the fix/defensive_unicode branch June 21, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants