2013-10-24 15:34 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* include/dbinfo.ch
* include/hbrdddbf.h
* src/rdd/dbf1.c
+ added default codepage setting RDDI_CODEPAGE for DBF RDD (and all
inherited RDDs). This helps to do an easy migration of application
to unicode, using existing dbf files:
HB_CDPSELECT("UTF8EX")
RDDINFO(RDDI_CODEPAGE, <codepage_used_in_dbf>)
This commit is contained in:
@@ -10,6 +10,16 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2013-10-24 15:34 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
|
||||
* include/dbinfo.ch
|
||||
* include/hbrdddbf.h
|
||||
* src/rdd/dbf1.c
|
||||
+ added default codepage setting RDDI_CODEPAGE for DBF RDD (and all
|
||||
inherited RDDs). This helps to do an easy migration of application
|
||||
to unicode, using existing dbf files:
|
||||
HB_CDPSELECT("UTF8EX")
|
||||
RDDINFO(RDDI_CODEPAGE, <codepage_used_in_dbf>)
|
||||
|
||||
2013-10-23 14:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* contrib/gtqtc/gtqtc1.cpp
|
||||
* added support for keyevents with multicharacter strings.
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
#define RDDI_PASSWORD 42 /* Get/Set default password */
|
||||
#define RDDI_LOCKRETRY 43 /* Get/Set record and file lock timeout value */
|
||||
#define RDDI_DIRTYREAD 44 /* Get/Set index dirty read flag */
|
||||
#define RDDI_CODEPAGE 45 /* Default codepage used by RDD */
|
||||
|
||||
/*
|
||||
Constants for SELF_ORDINFO ()
|
||||
|
||||
@@ -137,6 +137,8 @@ typedef struct _DBFDATA
|
||||
char * szTrigger;
|
||||
char * szPendingTrigger;
|
||||
|
||||
PHB_CODEPAGE pCodepage; /* Default RDD codepage */
|
||||
|
||||
HB_BYTE bLockType; /* 0 */
|
||||
HB_BYTE bTableType; /* DB_DBF_STD */
|
||||
HB_BYTE bCryptType; /* DB_CRYPT_NONE */
|
||||
|
||||
@@ -3381,12 +3381,10 @@ static HB_ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo )
|
||||
pArea->ulMemoBlockSize = 0;
|
||||
|
||||
if( pCreateInfo->cdpId )
|
||||
{
|
||||
pArea->area.cdPage = hb_cdpFindExt( pCreateInfo->cdpId );
|
||||
if( ! pArea->area.cdPage )
|
||||
pArea->area.cdPage = hb_vmCDP();
|
||||
}
|
||||
else
|
||||
if( ! pArea->area.cdPage )
|
||||
pArea->area.cdPage = DBFAREA_DATA( pArea )->pCodepage;
|
||||
if( ! pArea->area.cdPage )
|
||||
pArea->area.cdPage = hb_vmCDP();
|
||||
|
||||
pItem = hb_itemNew( NULL );
|
||||
@@ -4015,12 +4013,10 @@ static HB_ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo )
|
||||
}
|
||||
|
||||
if( pOpenInfo->cdpId )
|
||||
{
|
||||
pArea->area.cdPage = hb_cdpFindExt( pOpenInfo->cdpId );
|
||||
if( ! pArea->area.cdPage )
|
||||
pArea->area.cdPage = hb_vmCDP();
|
||||
}
|
||||
else
|
||||
if( ! pArea->area.cdPage )
|
||||
pArea->area.cdPage = DBFAREA_DATA( pArea )->pCodepage;
|
||||
if( ! pArea->area.cdPage )
|
||||
pArea->area.cdPage = hb_vmCDP();
|
||||
|
||||
pArea->fShared = pOpenInfo->fShared;
|
||||
@@ -6038,6 +6034,16 @@ static HB_ERRCODE hb_dbfRddInfo( LPRDDNODE pRDD, HB_USHORT uiIndex, HB_ULONG ulC
|
||||
return HB_FAILURE;
|
||||
break;
|
||||
|
||||
case RDDI_CODEPAGE:
|
||||
{
|
||||
const char * szCodepage = pData->pCodepage ? pData->pCodepage->id : NULL;
|
||||
|
||||
if( HB_IS_STRING( pItem ) )
|
||||
pData->pCodepage = hb_cdpFindExt( hb_itemGetCPtr( pItem ) );
|
||||
|
||||
hb_itemPutC( pItem, szCodepage );
|
||||
}
|
||||
|
||||
default:
|
||||
return SUPER_RDDINFO( pRDD, uiIndex, ulConnect, pItem );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user