summaryrefslogtreecommitdiff
path: root/src/core/stdfile
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-20 11:42:18 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-20 11:42:18 +0300
commit864601c41faeec6dea78baf6c14f15c3ba164486 (patch)
tree21595d02a9ab7e849109a14988b90a4e0dd96239 /src/core/stdfile
parentf45ed26f105ce9cccf19c54690695fb304ca7c57 (diff)
Telegram: fix for Unicode file names
Diffstat (limited to 'src/core/stdfile')
-rw-r--r--src/core/stdfile/src/file.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 4d007ec3ed..e8573eca6b 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -339,15 +339,20 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
blob.write(dbei);
}
else {
+ bool bUtf = (pre->dwFlags & PRFF_UTF) != 0;
CMStringW wszFiles;
for (int i = 0; i < pre->fileCount; i++) {
if (i != 0)
wszFiles.AppendChar(',');
- wszFiles.Append(_A2T(pre->files.a[i]));
+
+ if (bUtf)
+ wszFiles.Append(Utf2T(pre->files.a[i]));
+ else
+ wszFiles.Append(_A2T(pre->files.a[i]));
}
- DB::FILE_BLOB blob(wszFiles, _A2T(pre->descr.a));
+ DB::FILE_BLOB blob(wszFiles, bUtf ? Utf2T(pre->descr.a).get() : _A2T(pre->descr.a));
blob.write(dbei);
}