fix: Properly handle UTF-8 characters in ImGUI paths (#2122)

- Fixes a bug where users with special characters in their filenames would not be able to save `dalamudUI.ini`.
- Throw a special warning if `dalamudUI.ini` doesn't exist, as it's not an error case.
This commit is contained in:
KazWolfe 2024-11-24 14:01:01 -08:00 committed by GitHub
parent 0fdcffd3ad
commit 903a5ad5da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -604,10 +604,17 @@ internal partial class InterfaceManager : IInternalDisposableService
if (iniFileInfo.Length > 1200000)
{
Log.Warning("dalamudUI.ini was over 1mb, deleting");
iniFileInfo.CopyTo(Path.Combine(iniFileInfo.DirectoryName!, $"dalamudUI-{DateTimeOffset.Now.ToUnixTimeSeconds()}.ini"));
iniFileInfo.CopyTo(
Path.Combine(
iniFileInfo.DirectoryName!,
$"dalamudUI-{DateTimeOffset.Now.ToUnixTimeSeconds()}.ini"));
iniFileInfo.Delete();
}
}
catch (FileNotFoundException)
{
Log.Warning("dalamudUI.ini did not exist, ImGUI will create a new one.");
}
catch (Exception ex)
{
Log.Error(ex, "Could not delete dalamudUI.ini");

@ -1 +1 @@
Subproject commit 2f37349ffd778561a1103a650683116c43edc86c
Subproject commit d5dfde4b39b032430deb46bc61084c18fb54b986