From cb8839471b63bbab6691d43f98730c9abdce0ba0 Mon Sep 17 00:00:00 2001 From: BobSynfig <45494804+BobSynfig@users.noreply.github.com> Date: Jan 12 2019 16:16:55 +0000 Subject: Fix for #680 Windows (Untested) --- diff --git a/synfig-core/src/synfig/filecontainerzip.cpp b/synfig-core/src/synfig/filecontainerzip.cpp index b481483..8c6a09e 100644 --- a/synfig-core/src/synfig/filecontainerzip.cpp +++ b/synfig-core/src/synfig/filecontainerzip.cpp @@ -374,8 +374,12 @@ void FileContainerZip::read_history(std::list &list, FILE *f, fil std::list FileContainerZip::read_history(const String &container_filename) { std::list list; - + +#ifdef _WIN32 + FILE *f = fopen(Glib::locale_from_utf8(fix_slashes(container_filename)).c_str(), "rb"); +#else FILE *f = fopen(container_filename.c_str(), "rb"); +#endif if (f == NULL) return list; fseek(f, 0, SEEK_END); @@ -393,14 +397,23 @@ std::list FileContainerZip::read_history(const bool FileContainerZip::create(const String &container_filename) { if (is_opened()) return false; +#ifdef _WIN32 + storage_file_ = fopen(Glib::locale_from_utf8(fix_slashes(container_filename)).c_str(), "w+b"); +#else storage_file_ = fopen(fix_slashes(container_filename).c_str(), "w+b"); +#endif + if (is_opened()) changed_ = true; return is_opened(); } bool FileContainerZip::open_from_history(const String &container_filename, file_size_t truncate_storage_size) { if (is_opened()) return false; +#ifdef _WIN32 + FILE *f = fopen(Glib::locale_from_utf8(fix_slashes(container_filename)).c_str(), "r+b"); +#else FILE *f = fopen(fix_slashes(container_filename).c_str(), "r+b"); +#endif if (f == NULL) return false; // check size of file