This is a migrated thread and some comments may be shown as answers.

Unicode chars in dbf file

1 Answer 75 Views
Map
This is a migrated thread and some comments may be shown as answers.
Fredrik
Top achievements
Rank 1
Fredrik asked on 22 Nov 2010, 04:41 PM
Hello !!

In my dbf file I have unicode chars (å,ä,ö).
How can I get the correct chars when I´m reading the extendedproperty in my extendeddata?

Regards

Fredrik

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 24 Nov 2010, 04:38 PM
Hi Fredrik,

The encoding of DBF-file is determined automatically by MapShapeReader. Unfortunately the MapShapeReader does not contain property to assign certain encoding.
I have created the PITS issue for supporting this feature in future versions of RadMap. You can track its implementation using the following link:
http://www.telerik.com/support/pits.aspx#/public/silverlight/4118

Currently you can use the ShapeFileReader.Read method which allows to set encoding for DBF-file. You can retrieve elements with correct unicode chars in extended data using the following sample code:

var shapeUri = new Uri("/SilverlightApplication1;component/sampledata.shp", UriKind.Relative);
StreamResourceInfo shapeInfo = Application.GetResourceStream(shapeUri);
  
var dbfUri = new Uri("/SilverlightApplication1;component/sampledata.dbf", UriKind.Relative);
StreamResourceInfo dbfInfo = Application.GetResourceStream(dbfUri);
  
List<FrameworkElement> elements = ShapeFileReader.Read(shapeInfo.Stream, dbfInfo.Stream, Encoding.UTF8);

Sincerely,
Andrey Murzov
the Telerik team

Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Map
Asked by
Fredrik
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or