This project has moved. For the latest updates, please go here.

not support Big5 character?

Topics: SharpMap v0.9 / v1.x, WinForms Controls
Jul 20, 2010 at 9:23 AM

Hello all,

I'm first time to use SharpMap. I download version 0.9.

When I load .shp file, it works well.

But I set labelLayer and show it. RoadName shown as garbage characters.

Would anyone tell me how to do?

           SharpMap.Layers.LabelLayer layRoLadbel = new SharpMap.Layers.LabelLayer("Road labels");
            layRoLadbel.DataSource = layRoads.DataSource;
            //layCityLabel.Enabled = true;
            layRoLadbel.LabelColumn = "ROADNAME";
            layRoLadbel.Style = new SharpMap.Styles.LabelStyle();
            layRoLadbel.Style.ForeColor = Color.Black;
            layRoLadbel.Style.Font = new Font(FontFamily.GenericSerif, 11);
            //layRoLadbel.MaxVisible = layRoLadbel.MinVisible;
            layRoLadbel.Style.HorizontalAlignment = SharpMap.Styles.LabelStyle.HorizontalAlignmentEnum.Left;
            layRoLadbel.Style.VerticalAlignment = SharpMap.Styles.LabelStyle.VerticalAlignmentEnum.Bottom;
            layRoLadbel.Style.Offset = new PointF(3, 3);
            layRoLadbel.Style.Halo = new Pen(Color.Yellow, 2);
            layRoLadbel.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
            //layCityLabel.SmoothingMode = SmoothingMode.AntiAlias;
            layRoLadbel.SRID = 4326;
            layRoLadbel.LabelFilter = SharpMap.Rendering.LabelCollisionDetection.ThoroughCollisionDetection;
            layRoLadbel.Style.CollisionDetection = true;
            layRoLadbel.MaxVisible = 0.008;

Jul 20, 2010 at 10:38 AM

Hello carolting,

try to set the Encoding property of your ShapeFile provider to the appropriate value

((ShapeFileProvider)layRoads.DataSource).Encoding = System.Text.Encoding.GetEncoding(<your codepage number>);
Hth FObermaier