Skip to content

Commit

Permalink
fs::path utf-8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Nov 8, 2018
1 parent 86f658e commit b023626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions gdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ RasterDriver::RasterDriver(GDALDriver& driver)

RasterDataSet RasterDriver::create_dataset(int32_t rows, int32_t cols, int32_t numBands, const fs::path& filename, const std::type_info& dataType)
{
return RasterDataSet(checkPointer(_driver.Create(filename.string().c_str(), cols, rows, numBands, resolveType(dataType), nullptr), "Failed to create data set"));
return RasterDataSet(checkPointer(_driver.Create(filename.u8string().c_str(), cols, rows, numBands, resolveType(dataType), nullptr), "Failed to create data set"));
}

RasterDataSet RasterDriver::create_dataset(int32_t rows, int32_t cols, int32_t numBands, const std::type_info& dataType)
Expand All @@ -334,7 +334,7 @@ RasterDataSet RasterDriver::create_dataset_copy(const RasterDataSet& reference,
{
auto options = create_options_array(driverOptions);
return RasterDataSet(checkPointer(_driver.CreateCopy(
filename.string().c_str(),
filename.u8string().c_str(),
reference.get(),
FALSE,
options.size() == 1 ? nullptr : const_cast<char**>(options.data()),
Expand Down Expand Up @@ -363,7 +363,7 @@ bool VectorDriver::isSupported(VectorType type)

VectorDriver VectorDriver::create(const fs::path& filename)
{
auto vectorType = guess_vectortype_from_filename(filename.string());
auto vectorType = guess_vectortype_from_filename(filename.u8string());
if (vectorType != VectorType::Unknown) {
return create(vectorType);
}
Expand Down Expand Up @@ -400,14 +400,14 @@ VectorDataSet VectorDriver::create_dataset()
VectorDataSet VectorDriver::create_dataset(const fs::path& filename)

{
return VectorDataSet(checkPointer(_driver.Create(filename.string().c_str(), 0, 0, 0, GDT_Unknown, nullptr), "Failed to create vector data set"));
return VectorDataSet(checkPointer(_driver.Create(filename.u8string().c_str(), 0, 0, 0, GDT_Unknown, nullptr), "Failed to create vector data set"));
}

VectorDataSet VectorDriver::create_dataset_copy(const VectorDataSet& reference, const fs::path& filename, const std::vector<std::string>& driverOptions)
{
auto options = create_options_array(driverOptions);
return VectorDataSet(checkPointer(_driver.CreateCopy(
filename.string().c_str(),
filename.u8string().c_str(),
reference.get(),
FALSE,
options.size() == 1 ? nullptr : const_cast<char**>(options.data()),
Expand Down
2 changes: 1 addition & 1 deletion ui/polygonio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ OverlayMap loadShapes(const std::vector<std::pair<std::string, fs::path>>& shape
try {
data.emplace(QString::fromStdString(shpName), dataSetToGeoPath(ds, transformer));
} catch (const std::exception& e) {
Log::warn("Failed to add overlay {} ({})", shpPath.string(), e.what());
Log::warn("Failed to add overlay {} ({})", shpPath.u8string(), e.what());
}
}

Expand Down

0 comments on commit b023626

Please sign in to comment.