We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Illuminate\Support\Str::headline does not support umlauts (like ö,ä,ü). There are two related bugs I can see:
Illuminate\Support\Str::headline
public function test_make_umlauts_uppercase() { $input = 'ärmere-öffentliche-überraschungen-sind-öde'; $expected = 'Ärmere Öffentliche Überraschungen Sind Öde'; $output = Str::headline($input); $this->assertEquals($expected, $output); }
Yields the output:
Failed asserting that two strings are equal. Expected :'Ärmere Öffentliche Überraschungen Sind Öde' Actual :'ärmereöffentlicheüberraschungen Sindöde'
public function test_detect_uppercase_umlauts() { $input = 'sindÖdeUndSo'; $expected = 'Sind Öde Und So'; $output = Str::headline($input); $this->assertEquals($expected, $output); }
Failed asserting that two strings are equal. Expected :'Sind Öde Und So' Actual :'SindÖde Und So'
The text was updated successfully, but these errors were encountered:
@stevebauman
Sorry, something went wrong.
We'd welcome PR's for this, thank you.
This is because ucwords() doesn't handle unicode characters:
ucwords()
// ärmere öffentliche echo ucwords('ärmere öffentliche');
This means Str::studly() or anything relying on that method also does not work with unicode characters.
Str::studly()
We'll have to be crafty and use mb_convert_case(). I'll see if I can come up with something 👍
mb_convert_case()
No branches or pull requests
Description:
Illuminate\Support\Str::headline
does not support umlauts (like ö,ä,ü). There are two related bugs I can see:Steps To Reproduce:
Umlauts at the beginning of a word do not get capitalized
Yields the output:
Uppercase umlauts are not detected as uppercase
Yields the output:
The text was updated successfully, but these errors were encountered: