diff --git a/ChangeLog.txt b/ChangeLog.txt index 6d73cdd7f6..3ea1e9c2cd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,15 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2015-09-07 16:19 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/gtos2/gtos2.c + + added support for HB_GTI_CODEPAGE + ! removed code which sets CP437 at application start + Now the default codepage is the same set by system. + If someone wants to use CP437 regardless of default OS2 settings + then he should add to his code: + hb_gtInfo( HB_GTI_CODEPAGE, 437 ) + 2015-09-06 23:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/hbproces.c * use native OS2 system functions in hb_fsProcessOpen(), diff --git a/src/rtl/gtos2/gtos2.c b/src/rtl/gtos2/gtos2.c index ec90f30813..395e178ff2 100644 --- a/src/rtl/gtos2/gtos2.c +++ b/src/rtl/gtos2/gtos2.c @@ -850,6 +850,22 @@ static HB_BOOL hb_gt_os2_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE ); break; + case HB_GTI_CODEPAGE: + { + USHORT usCodePageNew = ( USHORT ) hb_itemGetNI( pInfo->pNewVal ); + USHORT usCodePage = 0; + + VioGetCp( 0, &usCodePage, 0 ); + pInfo->pResult = hb_itemPutNI( pInfo->pResult, usCodePage ); + if( ( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC ) && + usCodePageNew != usCodePage ) + { + if( VioSetCp( 0, usCodePageNew, 0 ) != NO_ERROR ) + VioSetCp( 0, usCodePage, 0 ); + } + break; + } + default: return HB_GTSUPER_INFO( pGT, iType, pInfo ); }