Skip to content

Commit 7bc8816

Browse files
[6.x] Filter invalid UTF-8 locales from dictionary (#14426)
1 parent a33919e commit 7bc8816

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Dictionaries/Locales.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ protected function getItems(): array
2020
$output = Process::run($this->buildLocalesCommand());
2121

2222
return collect(explode(PHP_EOL, $output))
23+
->filter(fn ($locale) => mb_check_encoding($locale, 'UTF-8'))
2324
->map(fn ($locale) => Str::before($locale, '.'))
2425
->reject(fn ($locale) => in_array($locale, ['C', 'POSIX']))
2526
->filter()

0 commit comments

Comments
 (0)