Skip to content

[13.x] Fix Str::camel() not lowercasing multibyte first characters - #61545

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
rayblair06:13.x-camel-multibyte
Sep 11, 2026
Merged

[13.x] Fix Str::camel() not lowercasing multibyte first characters#61545
taylorotwell merged 1 commit into
laravel:13.xfrom
rayblair06:13.x-camel-multibyte

Conversation

@rayblair06

Copy link
Copy Markdown
Contributor

Str::camel() lowercases the first character with PHP's native lcfirst(), which only handles ASCII letters, so strings that start with an accented or non-Latin letter keep their capital:

Str::camel('Über uns');   // expected "überUns", but got "ÜberUns"
Str::camel('émile_zola'); // expected "émileZola", but got "ÉmileZola"

Str::studly() already capitalises each word with the multibyte-safe Str::ucfirst(), so this PR switches camel() to the matching Str::lcfirst(). ASCII strings are unaffected.

@taylorotwell
taylorotwell merged commit 2a1b032 into laravel:13.x Sep 11, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants