Unicode chars in dbf file

2 posts, 0 answers
  1. Fredrik
    Fredrik avatar
    54 posts
    Member since:
    Sep 2010

    Posted 22 Nov 2010 Link to this post

    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
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 24 Nov 2010 Link to this post

    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
  3. DevCraft banner
Back to Top