Closed Alexey-Stolyarov closed 1 month ago
In this line you're trying to use content of cpg file as is. But whitespaces, line endings, etc prevents to detect correct encoding. https://github.com/NetTopologySuite/NetTopologySuite.IO.ShapeFile/blob/bef5ec80cc5b1b5a95f4df3bfc5a61ab837525a1/src/NetTopologySuite.IO.ShapeFile/Dbase/DbaseFileHeader.cs#L511
E.g. these lines will lead to ArgumentException which will lead to default encoding instead of desirable.
Encoding.GetEncoding("UTF-8/r/n") Encoding.GetEncoding("UTF-8 ")
Suggestion - trim leading and trailing whitespaces.
Support for a different encodings has been added in the successor library. There is also a sample code demonstrating how to custom encoding.
In this line you're trying to use content of cpg file as is. But whitespaces, line endings, etc prevents to detect correct encoding. https://github.com/NetTopologySuite/NetTopologySuite.IO.ShapeFile/blob/bef5ec80cc5b1b5a95f4df3bfc5a61ab837525a1/src/NetTopologySuite.IO.ShapeFile/Dbase/DbaseFileHeader.cs#L511
E.g. these lines will lead to ArgumentException which will lead to default encoding instead of desirable.
Suggestion - trim leading and trailing whitespaces.