Skip to content

Commit

Permalink
fix: explicitly construct utf-8 Strings
Browse files Browse the repository at this point in the history
fixes a regression caused by a changed default in the engine, see godotengine/godot-cpp#784
  • Loading branch information
LandscapeLab Office committed Apr 11, 2024
1 parent 19885a4 commit b668a3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/geofeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void GeoFeature::_bind_methods() {
}

String GeoFeature::get_attribute(String name) const {
return gdal_feature->get_attribute(name.utf8().get_data());
return String::utf8(gdal_feature->get_attribute(name.utf8().get_data()));
}

void GeoFeature::set_attribute(String name, String value) {
Expand All @@ -32,7 +32,7 @@ Dictionary GeoFeature::get_attributes() const {
std::map<std::string, std::string> attribute_map = gdal_feature->get_attributes();

for (const auto &attribute : attribute_map) {
attributes[attribute.first.c_str()] = attribute.second.c_str();
attributes[attribute.first.c_str()] = String::utf8(attribute.second.c_str());
}

return attributes;
Expand Down

0 comments on commit b668a3c

Please sign in to comment.