mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Revert "Fix regression from https://gitlab.com/OpenMW/openmw/-/merge_requests/1776"
This reverts commit 6a5ad4ca43
.
This commit is contained in:
parent
864112b5db
commit
b817359bcf
@ -3,20 +3,11 @@
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
|
||||
#if defined(_WIN32) || defined(__WINDOWS__)
|
||||
#include <boost/locale.hpp>
|
||||
#endif
|
||||
|
||||
namespace Files
|
||||
{
|
||||
std::unique_ptr<std::ifstream> openBinaryInputFileStream(const std::filesystem::path &path)
|
||||
{
|
||||
#if defined(_WIN32) || defined(__WINDOWS__)
|
||||
std::wstring wpath = boost::locale::conv::utf_to_utf<wchar_t>(path);
|
||||
auto stream = std::make_unique<std::ifstream>(wpath, std::ios::binary);
|
||||
#else
|
||||
auto stream = std::make_unique<std::ifstream>(path, std::ios::binary);
|
||||
#endif
|
||||
if (!stream->is_open())
|
||||
throw std::runtime_error("Failed to open '" + path.string() + "' for reading: " + std::strerror(errno)); //TODO(Project579): This will probably break in windows with unicode paths
|
||||
stream->exceptions(std::ios::badbit);
|
||||
|
Loading…
Reference in New Issue
Block a user