Skip to content

file_manager: Fix panic on Unicode filenames

Jeremy Soller requested to merge xTibor:fix-unicode into master

Created by: xTibor

This PR fixes a problem where the File Manager panicked on trying to extract the file extension of Unicode filenames. The code assumed that the UTF-8 characters are one byte long. (They're not.)

For example trying to list a file named "ő" (Char: U+0151, UTF-8: 0xC5 0x91) produced the following panic:

thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside 'ő' (bytes 0..2) of `ő`'

Merge request reports