1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

[FileBrowser] if text cannot be converted, try to mangle it into something.

Issue: #1471
This commit is contained in:
Dave Davenport 2021-09-22 19:08:32 +02:00
parent e116aa5bc1
commit e081feec27

View file

@ -250,8 +250,7 @@ static void get_file_browser(Mode *sw) {
pd->array[pd->array_length].name =
g_filename_to_utf8(rd->d_name, -1, NULL, NULL, NULL);
if (pd->array[pd->array_length].name == NULL) {
pd->array[pd->array_length].name =
g_strdup("Invalid UTF-8 filename.");
pd->array[pd->array_length].name = rofi_force_utf8(rd->d_name, -1);
}
pd->array[pd->array_length].path =
g_build_filename(cdir, rd->d_name, NULL);
@ -273,8 +272,7 @@ static void get_file_browser(Mode *sw) {
pd->array[pd->array_length].name =
g_filename_to_utf8(rd->d_name, -1, NULL, NULL, NULL);
if (pd->array[pd->array_length].name == NULL) {
pd->array[pd->array_length].name =
g_strdup("Invalid UTF-8 filename.");
pd->array[pd->array_length].name = rofi_force_utf8(rd->d_name, -1);
}
pd->array[pd->array_length].path =
g_build_filename(cdir, rd->d_name, NULL);