*** Documentation for pdbflang ***
Alexander von Lnen
March 2006

*Section 1. Introduction*
When importing dBase files that were created by other applications, you often face the problem 
of a missing language driver identifier (LDID), since only few application support this feature. 
According to the dBase file format specification, the LDID is stored at byte 29 (Hex: 1D) 
of the *.dbf file. So basically, you could load the dBase file into a hex editor, alter byte 
29 to the appropriate value and save it to disk. Since using a hex editor is not everybody's 
thing, I created a small command-line utility to patch a dBase file at byte 29 with a 
specified value. This furthermore gives you a chance to patch a whole bunch of dBase file in 
batch mode.

*Section 2. General Usage*
Program is run by: pdbflang -c # file1.dbf [file2.dbf ...]
Where '#' is the number to be patched to the dBase file filename.dbf. See Appendix A for a list 
of values, or use 'pdbflang -list' to print it on screen. You specify several dBase files on the 
command line or '*.dbf' to process ALL dBase files in that directory.

Note: I don't do much error checking in my utility. So you could just patch ANY file at byte 29 
to any value. So check for yourself what you're doing. Don't blame me if you broke your neck.

*Section 3. Example*
I used to run a project in school that used MS Access 2000 as geodatabase. We collected and 
manipulated the data in Access, and we were satisfied with the data, we exported it as dBase 
files. Those files were then imported to ESRI ArcView3.2a. Unfortunately, Access exported the 
dBase files with DOS Codepage 850 (I live in Germany), while ArcView relied on the system 
codepage, which was Windows Codepage 1252 (often called simply 'ANSI' codepage). ArcView 
recognized the LDID in dBase files and converts the codepage accordingly. Access doesn't set the 
LDID byte, though (it leaves it at 0). So ArcView thinks the dBase file is in the same codepage as 
the system's default, which messes up the special characters when you open the dBase file in 
ArcView. While there is a method to tell ArcView to handle such cases 
(see http://www.esricanada.com/english/support/faqs/arcview/avfaq21.asp), I wanted to manipulate
the files directly, so other folks would not need to change their ArcView configuration when I 
send them my files.

So, in short, if you want to patch your dBase file to DOS codepage 850 so that e.g. ArcView 
recognizes it as such, you would type: pdbflang -c 16 myfile.dbf

To process two files: pdbflang -c 16 myfile1.dbf myfile2.dbf

To process all files in a directory: pdbflang -c 16 *.dbf

You can look up the values in the list in Appendix A. I included the whole list, even though some 
values look a bit fancy. I guess those values with the 'dBASE' prefix will work fine for most 
people. I'm not an expert in all the programs that export dBase files, so please don't bother. I
recommend you try some values until you found the one that serves you well.

*Appendix A. List Language IDs as found on the net:*

From  	Ivar B. Jessen <bergishagen@it.notthis.dk>
Date 	Sun, 11 May 2003 19:29:34 +0200
Newsgroups 	dbase.native-tables
 
Table of language driver ID's in byte 29 of level 5 dbf table
and corresponding language drivers installed on the computer.

ID   ID as   No.    Long name of             Short Name of
      hex            language driver          language driver
------------------------------------------------------------

1    0x1     1      Paradox 'ascii'          ASCII
2    0x2     2      Paradox 'intl'           INTL
3    0x3     3      Paradox 'japan'          JAPAN
4    0x4     4      Paradox 'nordan'         NORDAN
5    0x5     5      Paradox 'nordan40'       NORDAN40
6    0x6     6      Paradox 'swedfin'        SWEDFIN
8    0x8     7      dBASE DAN cp865          DB865DA0
9    0x9     8      dBASE NLD cp437          DB437NL0
10   0xA     9      dBASE NLD cp850          DB850NL0
11   0xB     10     dBASE FIN cp437          DB437FI0
13   0xD     11     dBASE FRA cp437          DB437FR0
14   0xE     12     dBASE FRA cp850          DB850FR0
15   0xF     13     dBASE DEU cp437          DB437DE0
16   0x10    14     dBASE DEU cp850          DB850DE0
17   0x11    15     dBASE ITA cp437          DB437IT0
18   0x12    16     dBASE ITA cp850          DB850IT1
19   0x13    17     dBASE JPN cp932          DB932JP0
20   0x14    18     dBASE ESP cp850          DB850ES0
21   0x15    19     dBASE SVE cp437          DB437SV0
22   0x16    20     dBASE SVE cp850          DB850SV1
23   0x17    21     dBASE NOR cp865          DB865NO0
24   0x18    22     dBASE ESP cp437          DB437ES1
25   0x19    23     dBASE ENG cp437          DB437UK0
26   0x1A    24     dBASE ENG cp850          DB850UK0
27   0x1B    25     dBASE ENU cp437          DB437US0
28   0x1C    26     dBASE FRC cp863          DB863CF1
29   0x1D    27     dBASE FRC cp850          DB850CF0
31   0x1F    28     dBASE CSY cp852          DB852CZ0
32   0x20    29     dBASE CSY cp867          DB867CZ0
34   0x22    30     dBASE HUN cp852          DB852HDC
35   0x23    31     dBASE PLK cp852          DB852PO0
36   0x24    32     dBASE PTG cp860          DB860PT0
37   0x25    33     dBASE PTB cp850          DB850PT0
38   0x26    34     dBASE RUS cp866          DB866RU0
39   0x27    35     Borland DAN Latin-1      BLLT1DA0
40   0x28    36     Borland NLD Latin-1      BLLT1NL0
41   0x29    37     Borland FIN Latin-1      BLLT1FI0
42   0x2A    38     Borland FRA Latin-1      BLLT1FR0
43   0x2B    39     Borland FRC Latin-1      BLLT1CA0
44   0x2C    40     Borland DEU Latin-1      BLLT1DE0
45   0x2D    41     Borland ISL Latin-1      BLLT1IS0
46   0x2E    42     Borland ITA Latin-1      BLLT1IT0
48   0x30    43     Borland NOR Latin-1      BLLT1NO0
49   0x31    44     Borland ESP Latin-1      BLLT1ES0
51   0x33    45     Borland SVE Latin-1      BLLT1SV0
52   0x34    46     Borland ENG Latin-1      BLLT1UK0
53   0x35    47     Borland ENU Latin-1      BLLT1US0
54   0x36    48     Borland PTG Latin-1      BLLT1PT0
55   0x37    49     dBASE ENU cp850          DB850US0
57   0x39    50     Paradox 'intl' 850       INTL850
58   0x3A    51     Paradox ESP 437          SPANISH
59   0x3B    52     Paradox ISL 861          ICELAND
60   0x3C    53     Pdox ANSI Intl           ANSIINTL
61   0x3D    54     Pdox ANSI Intl850        ANSII850
62   0x3E    55     Pdox ANSI Spanish        ANSISPAN
63   0x3F    56     Pdox ANSI Swedfin        ANSISWFN
64   0x40    57     Pdox ANSI Nordan4        ANSINOR4
69   0x45    58     Paradox China 936        CHINA
70   0x46    59     Paradox Korea 949        KOREA
71   0x47    60     Paradox Taiwan 950       TAIWAN
72   0x48    61     Paradox Thai 874         THAI
77   0x4D    62     dBASE CHS cp936          DB936CN0
78   0x4E    63     dBASE KOR cp949          DB949KO0
79   0x4F    64     dBASE CHT cp950          DB950TW0
80   0x50    65     dBASE THA cp874          DB874TH0
86   0x56    66     dBASE JPN Dic932         DB932JP1
87   0x57    67     'ascii' ANSI             DBWINUS0
88   0x58    68     'WEurope' ANSI           DBWINWE0
89   0x59    69     'Spanish' ANSI           DBWINES0
90   0x5A    70     Access General           ACCGEN
91   0x5B    71     Access Nord/Danish       ACCNRDAN
92   0x5C    72     Access Swed/Finnish      ACCSWFIN
93   0x5D    73     Access Japanese          ACCJAPAN
94   0x5E    74     FoxPro German 437        FOXDE437
95   0x5F    75     FoxPro Nordic 437        FOXNO437
96   0x60    76     FoxPro Nordic 850        FOXNO850
97   0x61    77     FoxPro German 1252       FOXDEWIN
98   0x62    78     FoxPro Nordic 1252       FOXNOWIN
100  0x64    79     Paradox Czech 852        CZECH
101  0x65    80     pdx ISO L_2 Czech        IL2CZW
102  0x66    81     Paradox Polish 852       POLISH
103  0x67    82     Paradox Cyrr 866         CYRR
104  0x68    83     Paradox Hun 852 DC       HUN852DC
105  0x69    84     Paradox Greek GR437      GRCP437
107  0x6B    85     Paradox 'hebrew'         HEBREW
109  0x6D    86     Paradox Slovene 852      SLOVENE
110  0x6E    87     Paradox 'turk'           TURK
113  0x71    88     Paradox BUL 868          BULGARIA
116  0x74    89     Borland ANSI Arabic      BLWINAR0
117  0x75    90     Paradox ANSI HEBREW      ANHEBREW
120  0x78    91     Pdox ANSI Czech          ANCZECH
121  0x79    92     pdx Czech 852 'CH'       CZECHW
122  0x7A    93     pdx Czech 867 'CH'       CSKAMENW
123  0x7B    94     Paradox Czech 867        CSKAMEN
124  0x7C    95     pdx ANSI Czech 'CH'      ANCZECHW
125  0x7D    96     Pdox ANSI Polish         ANPOLISH
126  0x7E    97     Pdox ANSI Cyrillic       ANCYRR
127  0x7F    98     Pdox ANSI Hun. DC        ANHUNDC
128  0x80    99     Pdox ANSI Greek          ANGREEK1
130  0x82    100    Pdox ANSI Slovene        ANSISLOV
131  0x83    101    Pdox ANSI Turkish        ANTURK
133  0x85    102    Hebrew dBASE             DBHEBREW
134  0x86    103    dBASE ELL GR437          DB437GR0
135  0x87    104    dBASE SLO cp852          DB852SL0
136  0x88    105    dBASE TRK cp857          DB857TR0
142  0x8E    106    dBASE BUL 868            BGDB868
145  0x91    107    Access Greece            ACCGREEK
146  0x92    108    pdx ANSI ISO L_2 CZ      ANIL2CZW
148  0x94    109    Pdox ANSI Bulgaria       BGPD1251
155  0x9B    110    FoxPro Czech 1250        FOXCZWIN
156  0x9C    111    FoxPro Czech DOS895      FOXCZ895
199  0xC7    112    Pdox 'ascii' Japan       ASCII
201  0xC9    113    SQL Link ROMAN8          BLROM800
202  0xCA    114    Oracle SQL WE850         ORAWE850
203  0xCB    115    Sybase SQL Dic850        SYDC850
204  0xCC    116    Sybase SQL Dic437        SYDC437
205  0xCD    117    DB2 SQL ANSI DEU         DB2ANDEU
209  0xD1    118    MSSQL ANSI Greek         MSSGRWIN
*********************
End of File