Skip to content

Commit c935532

Browse files
committed
Check that database is using UTF-8 encoding
Otherwise osm2pgsql might not work correctly.
1 parent c706900 commit c935532

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/db-check.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ void check_db(options_t const &options)
5151
get_minimum_postgresql_server_version())};
5252
}
5353

54+
if (settings.at("server_encoding") != "UTF8") {
55+
throw std::runtime_error{"Database is not using UTF8 encoding."};
56+
}
57+
5458
auto const postgis_version = get_postgis_version(db_connection);
5559
log_info("PostGIS version: {}.{}", postgis_version.major,
5660
postgis_version.minor);

0 commit comments

Comments
 (0)