2009-10-19 10:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rtl/cdpapi.c
* harbour/include/hbapicdp.h
+ added new functions: hb_cdpStrnToU16LE() and hb_cdpStringInU16Length()
* harbour/contrib/rddads/rddads.h
! define (if not defined) x64 macro in all 64bit builds not only for
MinGW64
* define (if not defined) unix macro in all HB_OS_UNIX builds not only
for Linux. TOCHECK: CygWIN builds.
This commit is contained in:
@@ -17,6 +17,17 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-10-19 10:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/src/rtl/cdpapi.c
|
||||
* harbour/include/hbapicdp.h
|
||||
+ added new functions: hb_cdpStrnToU16LE() and hb_cdpStringInU16Length()
|
||||
|
||||
* harbour/contrib/rddads/rddads.h
|
||||
! define (if not defined) x64 macro in all 64bit builds not only for
|
||||
MinGW64
|
||||
* define (if not defined) unix macro in all HB_OS_UNIX builds not only
|
||||
for Linux. TOCHECK: CygWIN builds.
|
||||
|
||||
2009-10-19 01:31 UTC+0600 April White (april users.sourceforge.net)
|
||||
+ harbour/doc/en-en/1stread.txt
|
||||
! initial version of a 'doc' formatted 'read-me' file
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
#if defined( HB_OS_WIN ) && !defined( WIN32 )
|
||||
#define WIN32
|
||||
#endif
|
||||
#if !defined( unix ) && ( defined( __LINUX__ ) || defined( HB_OS_LINUX ) )
|
||||
#if !defined( unix ) && defined( HB_OS_UNIX )
|
||||
#define unix
|
||||
#endif
|
||||
#if defined( __MINGW64__ )
|
||||
#if !defined( x64 ) && defined( HB_ARCH_64BIT )
|
||||
#define x64
|
||||
#endif
|
||||
#if defined( __WATCOMC__ ) || defined( __LCC__ )
|
||||
|
||||
@@ -333,6 +333,8 @@ extern HB_EXPORT BOOL hb_cdpGetFromUTF8( PHB_CODEPAGE, BOOL, UCHAR, int
|
||||
extern HB_EXPORT ULONG hb_cdpStrnToUTF8( PHB_CODEPAGE, BOOL, const char *, ULONG, char * );
|
||||
extern HB_EXPORT ULONG hb_cdpStrnToUTF8n( PHB_CODEPAGE, BOOL, const char *, ULONG, char *, ULONG );
|
||||
extern HB_EXPORT ULONG hb_cdpStrnToU16( PHB_CODEPAGE, BOOL, const char *, ULONG, char * );
|
||||
extern HB_EXPORT ULONG hb_cdpStrnToU16LE( PHB_CODEPAGE, BOOL, const char *, ULONG, char * );
|
||||
extern HB_EXPORT ULONG hb_cdpStringInU16Length( PHB_CODEPAGE, BOOL, const char *, ULONG );
|
||||
extern HB_EXPORT ULONG hb_cdpStringInUTF8Length( PHB_CODEPAGE, BOOL, const char *, ULONG );
|
||||
extern HB_EXPORT ULONG hb_cdpStringInUTF8Length2( PHB_CODEPAGE, BOOL, const char *, ULONG, ULONG );
|
||||
extern HB_EXPORT ULONG hb_cdpUTF8ToStrn( PHB_CODEPAGE, BOOL, const char *, ULONG, char *, ULONG );
|
||||
|
||||
@@ -997,6 +997,23 @@ ULONG hb_cdpStrnToUTF8n( PHB_CODEPAGE cdp, BOOL fCtrl,
|
||||
return n;
|
||||
}
|
||||
|
||||
ULONG hb_cdpStringInU16Length( PHB_CODEPAGE cdp, BOOL fCtrl,
|
||||
const char *pSrc, ULONG ulLen )
|
||||
{
|
||||
if( cdp && cdp->uniTable )
|
||||
{
|
||||
/*
|
||||
* TODO: add support for multibyte characters
|
||||
*/
|
||||
}
|
||||
|
||||
HB_SYMBOL_UNUSED( cdp );
|
||||
HB_SYMBOL_UNUSED( fCtrl );
|
||||
HB_SYMBOL_UNUSED( pSrc );
|
||||
|
||||
return ulLen << 1;
|
||||
}
|
||||
|
||||
ULONG hb_cdpStrnToU16( PHB_CODEPAGE cdp, BOOL fCtrl,
|
||||
const char * pSrc, ULONG ulLen, char * pDst )
|
||||
{
|
||||
@@ -1039,6 +1056,48 @@ ULONG hb_cdpStrnToU16( PHB_CODEPAGE cdp, BOOL fCtrl,
|
||||
return i << 1;
|
||||
}
|
||||
|
||||
ULONG hb_cdpStrnToU16LE( PHB_CODEPAGE cdp, BOOL fCtrl,
|
||||
const char * pSrc, ULONG ulLen, char * pDst )
|
||||
{
|
||||
USHORT u, *uniCodes, nChars;
|
||||
ULONG i;
|
||||
|
||||
if( cdp && cdp->uniTable )
|
||||
{
|
||||
if( cdp->nMulti || cdp->uniTable->lMulti )
|
||||
{
|
||||
/*
|
||||
* TODO: this translation is bad, please fix me!!!
|
||||
*/
|
||||
for( i = 0; i < ulLen; i++, pDst += 2 )
|
||||
{
|
||||
u = hb_cdpGetU16( cdp, fCtrl, ( UCHAR ) pSrc[ i ] );
|
||||
HB_PUT_LE_UINT16( pDst, u );
|
||||
}
|
||||
return i << 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
uniCodes = cdp->uniTable->uniCodes;
|
||||
nChars = ( USHORT ) cdp->uniTable->nChars;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nChars = 0;
|
||||
uniCodes = NULL;
|
||||
}
|
||||
|
||||
for( i = 0; i < ulLen; i++, pDst += 2 )
|
||||
{
|
||||
u = ( UCHAR ) pSrc[ i ];
|
||||
if( uniCodes && u < nChars && ( fCtrl || u >= 32 ) )
|
||||
u = uniCodes[ u ];
|
||||
HB_PUT_LE_UINT16( pDst, u );
|
||||
}
|
||||
return i << 1;
|
||||
}
|
||||
|
||||
ULONG hb_cdpnDupLen( const char * pszSrc, ULONG ulLen,
|
||||
PHB_CODEPAGE cdpIn, PHB_CODEPAGE cdpOut )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user