2

i'm creating Shapes using GeoTools SimpleFeatureType, SimpleFeatureBuilder and featureBuilder.add(...). (i can add snips if requested)

Data Source is postgresql.

Displaying the shapes with QGIS shows "???" in the locname field (there should be "東京都" for Tokyo) same problems for wikimedia.

enter image description here

Last year, i did the conversion postgresql -> shape using pgsql2shp, which was running fine. No, i can't switch back to that!

enter image description here

Is there any way to specify which encoding to use in geoTools? Or whatelse am i doing wrong?

1 Answer 1

5

The shapefile standard is old and the original/official version only allowed for ISO-8851 characters. GeoTools by default generates compliant shapefiles in ISO-8851.

If you want you can instruct it to generate DBFs in UTF-8, see the documentation here: http://docs.geotools.org/stable/userguide/library/data/shape.html

3
  • ok, osm2pgsql does not "respect" the standard - and that was fine for me ;) Tnx for pointing to the solution, i'll install it at once.
    – wambacher
    Feb 20, 2018 at 11:04
  • running fine :)
    – wambacher
    Feb 20, 2018 at 11:11
  • sorry: pgsql2shp, not osm2pgsql
    – wambacher
    Feb 20, 2018 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.