Oxenstierna Andreas ha scritto: > Great enhancement for all non-A-Z languages. > > How will the encoding be stored in the DBF-file? > ESRI has two ways of doing this, either storing LDID in the DBF > header or creating a textfile <filename>.cpg which stores the codepage. > See > http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=26015 > > <http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=26015>
Hum, not sure we can use any of these... In particular, Java has no notion of what a codepage is, only knows about Locale and Charset, both basically go with the standard encoding names such as ISO-8859-xx or UTF8/16/32 family. For reading foreign chars shapefiles we already allow the user to specify the encoding that way, and for writing we would to the same, but how to turn a java.nio.Charset to a codepage number is something I don't know. By quickly looking around with Google I've found this library (http://cpdetector.sourceforge.net/) that does the opposite, it guesses the encoding based on the file contents, and it's called Code Page detector, but in fact it does return a java.nio.Charset. By looking more I've found this post (http://forums.sun.com/thread.jspa?messageID=10372122) where someone states that codepage concept is not supported by Java as it's something Windows specific. There was some discussion about codepage support in OGR, not sure how it turned out: http://article.gmane.org/gmane.comp.gis.gdal.devel/8710 So it seems to pull this we'd first need to build a conversion table from codepages to encodings, provided that is even possible. Seems like quite a bit of long boring work... Cheers Andrea PS: more info about code pages here: http://en.wikipedia.org/wiki/Code_page -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
