8000 [String] Fix the `snake` method behavior with uppercase strings and special characters by antten · Pull Request #57788 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[String] Fix the snake method behavior with uppercase strings and special characters #57788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[String] Add UTF-8 encoding and fix converting to lower case on byte …
…string.
  • Loading branch information
antten committed Jul 20, 2024
commit 88bcc3a17f8f073af8e98652399cfbec6fc28dfd
2 changes: 1 addition & 1 deletion src/Symfony/Component/String/AbstractUnicodeString.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public function snake(): parent

$strings = array_map(
function (string $matchedString) {
return mb_strtolower($matchedString);
return mb_strtolower($matchedString, 'UTF-8');
},
$matches[0] ?? []
);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/String/ByteString.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public function snake(): parent

$strings = array_map(
function (string $matchedString) {
return mb_strtolower($matchedString);
return strtolower($matchedString);
},
$matches[0] ?? []
);
Expand Down
0