diff --git a/CHANGELOG.md b/CHANGELOG.md index 4607a7e..d2c6cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [[v0.2.5](https://github.com/The-FireHub-Project/Runtime/compare/v0.2.4...v0.2.5)] – 2026-09-11 + +### Fixed +* Fix improper handling of empty string in `Char::ord` method by @dieselxxx + ## [[v0.2.4](https://github.com/The-FireHub-Project/Runtime/compare/v0.2.3...v0.2.4)] – 2026-09-03 ### Changed diff --git a/README.md b/README.md index c92d88f..2a24190 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ /> version diff --git a/src/Char/MB.php b/src/Char/MB.php index 9606bf0..d6d1701 100644 --- a/src/Char/MB.php +++ b/src/Char/MB.php @@ -86,7 +86,7 @@ public static function chr (int $codepoint, ?Encoding $encoding = null):string|f public static function ord (string $character, ?Encoding $encoding = null):int|false { /** @var non-negative-int|false */ - return mb_ord($character ?: "\0", $encoding?->value); + return mb_ord($character === '' ? "\0" : $character, $encoding?->value); }