diff --git a/packages/fcl-db/src/dbase/dbf_dbffile.pas b/packages/fcl-db/src/dbase/dbf_dbffile.pas index 40151cdc8b..726e3c67c6 100644 --- a/packages/fcl-db/src/dbase/dbf_dbffile.pas +++ b/packages/fcl-db/src/dbase/dbf_dbffile.pas @@ -195,7 +195,6 @@ type destructor Destroy; override; function CodePageInstalled(ACodePage: Integer): Boolean; - function CreateFoxProLangID(NewCodePage: integer): Byte; property CurrencyAsBCD: Boolean read FCurrencyAsBCD write FCurrencyAsBCD; property DefaultOpenCodePage: Integer read FDefaultOpenCodePage write FDefaultOpenCodePage; @@ -630,21 +629,19 @@ begin // determine codepage & locale if FDbfVersion in [xFoxPro, xVisualFoxPro] then begin - if FFileLangId = 0 then - FFileLangId := DbfGlobals.CreateFoxProLangID(DbfGlobals.DefaultCreateCodePage); - FFileCodePage := LangId_To_CodePage[FFileLangId]; - lLocaleID := LangId_To_Locale[FFileLangId]; - FUseCodePage := FFileCodePage; + // Don't use DbfGlobals default language ID as it is dbase-based + FFileLangId := ConstructLangId(LangId_To_CodePage[FFileLangId],GetUserDefaultLCID, true); end else begin // DBase if FFileLangId = 0 then FFileLangId := DbfGlobals.DefaultCreateLangId; - FFileCodePage := LangId_To_CodePage[FFileLangId]; - lLocaleID := LangId_To_Locale[FFileLangId]; - FUseCodePage := FFileCodePage; end; + FFileCodePage := LangId_To_CodePage[FFileLangId]; + lLocaleID := LangId_To_Locale[FFileLangId]; + FUseCodePage := FFileCodePage; + // prepare header size if FDbfVersion = xBaseVII then @@ -3088,11 +3085,6 @@ begin Result := FCodePages.IndexOf(Pointer(ACodePage)) >= 0; end; -function TDbfGlobals.CreateFoxProLangID(NewCodePage: integer): Byte; -begin - ConstructLangId(NewCodePage, GetUserDefaultLCID, true); -end; - initialization finalization FreeAndNil(DbfGlobals); diff --git a/packages/fcl-db/src/dbase/dbf_lang.pas b/packages/fcl-db/src/dbase/dbf_lang.pas index 6e851bf89b..0d3184609a 100644 --- a/packages/fcl-db/src/dbase/dbf_lang.pas +++ b/packages/fcl-db/src/dbase/dbf_lang.pas @@ -521,8 +521,7 @@ begin end; const - // range of Dbase / FoxPro locale; these are INCLUSIVE - + // range of Dbase / FoxPro locales; these are INCLUSIVE dBase_RegionCount = 4; dBase_Regions: array[0..dBase_RegionCount*2-1] of Byte = ($00, $00, @@ -538,6 +537,7 @@ begin DbfRes := 0; FoxRes := 0; // scan + //todo: verify this for visual foxpro; it doesn't seem to work. for I := 0 to $FF do begin // check if need to advance to next region