### Symfony version(s) affected 6.1, 6.2 ### Description If a path has multibyte characters before the last directory separator, the returned path is cut at the wrong position. ### How to reproduce Run the following PHP codes : `Path::getDirectory("D:/Folder/Aééé/Subfolder");` It will return `'D:/Folder/Aééé/Su'` instead of `'D:/Folder/Aééé'` ### Possible Solution Replace `strrpos` with `mb_strrpos` at line 161 in Path.php : ``` if (false === ($dirSeparatorPosition = strrpos($path, '/'))) { return ''; } ``` ### Additional Context _No response_