Skip to content

Commit

Permalink
fix the encoding of values read from Shapefile (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
Corgam authored Jul 12, 2024
2 parents 13be150 + 425e6b2 commit 3d29d11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions backend/src/BIE.DataPipeline/Import/ShapeImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ public bool ReadLine(out string nextLine)
{
var value = mParser.GetValue(i);
mStringBuilder.Append(", '");
mStringBuilder.Append(value);
var bytes = Encoding.GetEncoding("ISO-8859-1").GetBytes(value?.ToString() ?? "");
mStringBuilder.Append(Encoding.UTF8.GetString(bytes));
mStringBuilder.Append("'");
// nextLine += $", \'{(value != "" ? value : "null")}\'";
}
Expand Down Expand Up @@ -198,7 +199,7 @@ private double CalculateAreaInSquareMeters(Geometry geometry)
public string GetCreationHeader()
{
return mHeader.Fields.Aggregate("Location GEOMETRY",
(current, field) => current + $", {field.Name} VARCHAR(255)");
(current, field) => current + $", {field.Name} NVARCHAR(255)");
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"BIE.DataPipeline": {
"commandName": "Project",
"commandLineArgs": "--behavior=replace not_used/hausumringe_mittelfranken.yaml",
"commandLineArgs": "--behavior=replace common/actual_use_Kreisfreie_Stadt_Nuernberg.yaml",
"workingDirectory": "yaml",
"environmentVariables": {
"DB_SERVER": "localhost",
Expand Down

0 comments on commit 3d29d11

Please sign in to comment.