1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix #7533: Screenshot is incorrectly named in CJK

For Windows, convert path to UTF-16 before passing to fstream constructor.
This commit is contained in:
Ted John
2018-06-25 18:14:55 +01:00
parent 9e052c752b
commit 0f2ccebfe7
2 changed files with 11 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
- Feature: [#5993] Ride window prices can now be set via text input.
- Feature: [#6998] Guests now wait for passing vehicles before crossing railway tracks.
- Feature: [#7694] Debug option to visualize paths that the game detects as wide.
- Fix: [#7533] Screenshot is incorrectly named/file is not generated in CJK language.
- Fix: [#7628] Always-researched items can be modified in the inventory list.
- Fix: [#7643] No Money scenarios with funding set to zero.
- Fix: [#7653] Finances money spinner is too narrow for big loans.

View File

@@ -309,7 +309,12 @@ namespace Imaging
return ReadFromFile(path, GetImageFormatFromPath(path));
default:
{
#if _WIN32
auto pathW = String::ToUtf16(path);
std::ifstream fs(pathW, std::ios::binary);
#else
std::ifstream fs(path.data(), std::ios::binary);
#endif
return ReadFromStream(fs, format);
}
}
@@ -330,7 +335,12 @@ namespace Imaging
break;
case IMAGE_FORMAT::PNG:
{
#ifdef _WIN32
auto pathW = String::ToUtf16(path);
std::ofstream fs(pathW, std::ios::binary);
#else
std::ofstream fs(path.data(), std::ios::binary);
#endif
WritePng(fs, image);
break;
}