That sounds great, but at the same time I'm a bit confused. The ESRI specification <https://desktop.arcgis.com/en/arcmap/10.3/manage-data/shapefiles/shapefile-file-extensions.htm> claims that the file contains a "codepage <https://en.wikipedia.org/wiki/Code_page>", while Java needs a Charset <https://en.wikipedia.org/wiki/Code_page>. And yet, if I look at the cpg files I have locally, the contents are either UTF-8 or Windows-1251, so indeed, charsets.
Can you shed some light on this? Cheers Andrea On Thu, Sep 14, 2023 at 9:46 PM Burkhard Strauss <servi...@strauss.eng.br> wrote: > Some providers of ESRI Shapefile data provide an additional *.cpg-file > containing the character set name for string-fields in the *.dbf-file. > One such provider is HERE/NavStreets street map data. > > Currently the API-user has to specify a Charset to the > ShapefileDataStoreFactory to ensure properly read string values. The > application has to ask the application-user to look up the Charset in > the *.cpg-file and copy or type the name. That's rather awkward. > > I prepared a solution which adds 15 lines to ShapefileDataStoreFactory > plus a unit-test and test-data. If a file named <my_shapefile>.cpg is > present beside <my_shapefile>.dbf and the other files, and the Charset > can be determined from the file without error, a possibly present > factory parameter is ignored and overridden by the Charset found in the > file. > > What do you think? > > Regards > Burkhard > > > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel > -- Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://bit.ly/gs-services-us for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions Group phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 https://www.geosolutionsgroup.com/ http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel