-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Problem Description
In several character conversion functions in , there are unsafe calls that can cause panics when handling invalid Unicode characters.
Specifically, these functions use :
- :
- :
- :
- :
These calls can panic if:
- fails (invalid Unicode codepoint)
- or returns (empty iterator)
Expected Behavior
These functions should handle invalid inputs gracefully by returning appropriate default values instead of panicking.
Proposed Solution
Replace with safer alternatives like or proper error handling. For example:
- For case conversion: fall back to the original character if conversion fails
- For character property checks: return for invalid characters
This would make the code more robust and prevent unexpected crashes when processing malformed or edge-case Unicode input.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels