我需要在形状文件中添加土耳其符号。但我无法在保存形状文件期间更改编码。下面是我的代码片段:
FeatureSet fs = new FeatureSet(FeatureType.Polygon);
ProjectionInfo pStart = new ProjectionInfo();
pStart = KnownCoordinateSystems.Geographic.World.WGS1984;
fs.Projection = pStart;
fs.DataTable.Columns.Add(new DataColumn("Sahə", typeof(string)));
// create a geometry (square polygon)
List<Coordinate> vertices = new List<Coordinate>();
vertices.Add(new Coordinate(50.060444958508015, 40.55967497639358));
vertices.Add(new Coordinate(50.061042001470923, 40.554836019873619));
vertices.Add(new Coordinate(50.056969989091158, 40.554629992693663));
vertices.Add(new Coordinate(50.055287992581725, 40.559944035485387));
vertices.Add(new Coordinate(50.060444958508015, 40.55967497639358));
Polygon geom = new Polygon(vertices);
// add the geometry to the featureset.
IFeature feature = fs.AddFeature(geom);
feature.DataRow.BeginEdit();
feature.DataRow["Sahə"] = "Əüei..";
feature.DataRow.EndEdit();
fs.SaveAs("C:\\test2.shp", true);
在 test2.dbf 文件中,一些符号 (ə,ü) 保存为 '?' 象征。