Turkish character, letter problem in sharpmap project

Topics: SharpMap Project, Web Controls
Mar 8, 2010 at 10:47 PM
Edited Mar 8, 2010 at 10:49 PM

Everything is OK!

But, I have a problem with Turkish character when showing Turkey Map.

A lot of city names contain Turkish letter, character. For example İstanbul, Çanakkale, Niğde, Şırnak....

I am using this line for showing City Label ---->     layCityLabel.Style.Font =new Font(FontFamily.GenericSerif, 10);

How can I solve this problem?




Mar 11, 2010 at 9:48 PM
Edited Mar 11, 2010 at 9:56 PM

Hello memogum,

I doubt it has anything to do with the font you use. There is -probably- missing or wrong encoding information for your dbase file.

Please try to set the codepage manually:

SharpMap.Data.Provider.ShapeFile sf = new
SharpMap.Data.Provider.ShapeFile(<filename>, true);
sf.Encoding = System.Text.Encoding.GetEncoding(<Codepage usually used in Turkey or whereever it was made, e.g. 1254, 857?>);


Hth FObermaier



Mar 12, 2010 at 10:45 AM
Edited Mar 12, 2010 at 7:17 PM

Hello fobermaier;

Thank you, for your help. It worked out.

Best regard.

code is here


sf = new ShapeFile(HttpContext.Current.Server.MapPath(@"~\App_data\shpFile.shp"), true);

sf.Encoding = System.Text.