public class DbaseCodepage
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static short[] |
dbfLdid
Define the valid dbf Language driver IDs (equivalent to MSDOS code pages), which are used on the byte 29
of the DBF header to define the DBF codepage.
|
static java.lang.String[] |
ldidJava
Equivalent Java charset names to the code pages defined in
dbfLdid, using Java NIO Charset names
(which differ from JAVA IO names, see https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) |
| Constructor and Description |
|---|
DbaseCodepage(java.io.File dbfFile)
Defines the dbfFile and constructs the name of the .cpg
file based on it
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
cpg2java(java.lang.String codePage) |
java.lang.String |
getCharset() |
static java.lang.String |
getCharsetName(int ldid)
Gets the Java NIO charset name equivalent to the provided ldid
value.
|
static java.lang.String |
getCpgFileName(java.lang.String dbfFile) |
static int |
getLdid(java.lang.String charsetName)
Gets the dbf Language driver IDs (code pages) corresponding
to the provided charset name
|
static java.lang.String |
java2cpg(java.lang.String charset) |
java.lang.String |
read()
Reads the charset from the codepage file, and updates the internal
charset definition
|
void |
setCharset(java.lang.String charset) |
void |
write(java.lang.String charset)
Writes the specified charset to the codepage file, and updates
the internal charset definition
|
public static final short[] dbfLdid
ldidJava array
(so 0x01 is equivalent to IBM437, 0x02 to IBM850, etc)
See some other equivalences in:
https://github.com/infused/dbf/blob/master/docs/supported_encodings.csv
https://github.com/olemb/dbfread/blob/master/dbfread/codepages.py
https://joinup.ec.europa.eu/svn/gvsig-desktop/trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dbf/DbfEncodings.javapublic static final java.lang.String[] ldidJava
dbfLdid, using Java NIO Charset names
(which differ from JAVA IO names, see https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html)public DbaseCodepage(java.io.File dbfFile)
public static java.lang.String getCpgFileName(java.lang.String dbfFile)
public java.lang.String getCharset()
public void setCharset(java.lang.String charset)
public static java.lang.String cpg2java(java.lang.String codePage)
public static java.lang.String java2cpg(java.lang.String charset)
public java.lang.String read()
public void write(java.lang.String charset)
public static int getLdid(java.lang.String charsetName)
public static java.lang.String getCharsetName(int ldid)