diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 43ddee119c..caa40333bf 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2012-05-04 01:51 UTC+0200 Viktor Szakats (harbour syenar.net) + * include/harbour.hbx + * src/rtl/cdpapihb.c + + HB_CDPCHARMAX( [] ) -> + (ATM 0xFFFF for unicode or 0xFF for non-unicode (default) CPs) + 2012-05-04 01:12 UTC+0200 Viktor Szakats (harbour syenar.net) * src/rtl/hbstrsh.c + HB_STRSHRINK() updated to work on custom character indexes (UTF8) @@ -166,7 +172,7 @@ ; TOFIX: cmdline arguments via Main() parameters, hb_AParams() and hb_cmdLine() on Windows. ; TODO: Add a way to detect maximum bit width of unicode chars, - for now I hard-coded 16-bit. + for now I hard-coded 16-bit. [DONE] 2012-04-26 10:35 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/src/rtl/hbgtcore.c diff --git a/harbour/include/harbour.hbx b/harbour/include/harbour.hbx index 64744db9f2..f59ca19e01 100644 --- a/harbour/include/harbour.hbx +++ b/harbour/include/harbour.hbx @@ -335,6 +335,7 @@ DYNAMIC hb_ByteSwapL DYNAMIC hb_ByteSwapLL DYNAMIC hb_ByteSwapU DYNAMIC hb_ByteSwapW +DYNAMIC hb_cdpCharMax DYNAMIC hb_cdpInfo DYNAMIC hb_cdpIsUTF8 DYNAMIC hb_cdpList diff --git a/harbour/src/rtl/cdpapihb.c b/harbour/src/rtl/cdpapihb.c index bc405227a4..6cefbda9d2 100644 --- a/harbour/src/rtl/cdpapihb.c +++ b/harbour/src/rtl/cdpapihb.c @@ -106,6 +106,11 @@ HB_FUNC( HB_CDPINFO ) hb_retc( cdp ? cdp->info : NULL ); } +HB_FUNC( HB_CDPCHARMAX ) +{ + hb_retnl( ( 1 << ( ( int ) ( hb_cdpIsUTF8( hb_cdpFindExt( hb_parcx( 1 ) ) ) ? sizeof( HB_WCHAR ) : sizeof( HB_UCHAR ) ) * 8 ) ) - 1 ); +} + HB_FUNC( HB_CDPISUTF8 ) { hb_retl( hb_cdpIsUTF8( hb_cdpFindExt( hb_parcx( 1 ) ) ) );