I think you need to provide the correct charset connection parameter.

We have had a poor experience with DBF file headers recording the correct
character set.  perhaps cpg would have a better track record.

Here is an outstanding patch, focused on just the DBF header (which can
also record charset).

https://osgeo-org.atlassian.net/browse/GEOT-3377

This patch is missing a test case but you may be able to clean it up?




--
Jody Garnett

On 18 May 2016 at 10:54, Alexander Bruy <[email protected]> wrote:

> Hi all,
>
> I have shapefiles with different attribute encodings: UTF-8, WIN-1251 etc,
> and want to process them with GeoTools.
>
> Does GeoTools support .cpg files which specify ecoding of the shapefile
> attributes, like OGR does? Or the only way to read data correctly is to
> specify encoding manually using methods like [0, 1]?
>
> Thanks
>
> [0]
> http://docs.geotools.org/stable/javadocs/org/geotools/data/shapefile/ShapefileDataStoreFactory.html#DBFCHARSET
> [1]
> http://docs.geotools.org/stable/javadocs/org/geotools/data/shapefile/ShapefileDataStore.html#setCharset%28java.nio.charset.Charset%29
>
> --
> Alexander Bruy
>
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data
> untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to