8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 02:03:03 +01:00
This commit is contained in:
asfernandes 2008-10-12 15:57:39 +00:00
parent 526fd5efee
commit 478b27120b
3 changed files with 8 additions and 9 deletions

View File

@ -154,7 +154,7 @@ ULONG CVBIG5_unicode_to_big5(csconvert* obj,
const int tmp2 = big5_ch % 256; const int tmp2 = big5_ch % 256;
if (tmp1 == 0) { /* ASCII character */ if (tmp1 == 0) { /* ASCII character */
fb_assert((UCHAR(tmp2)&0x80)==0); fb_assert((UCHAR(tmp2) & 0x80) == 0);
*big5_str++ = tmp2; *big5_str++ = tmp2;
big5_len--; big5_len--;

View File

@ -153,7 +153,7 @@ ULONG CVGB_unicode_to_gb2312(csconvert* obj,
const int tmp2 = gb_ch % 256; const int tmp2 = gb_ch % 256;
if (tmp1 == 0) { /* ASCII character */ if (tmp1 == 0) { /* ASCII character */
fb_assert((UCHAR(tmp2)&0x80)==0); fb_assert((UCHAR(tmp2) & 0x80) == 0);
*gb_str++ = tmp2; *gb_str++ = tmp2;
gb_len--; gb_len--;

View File

@ -65,7 +65,7 @@ ULONG CVKSC_ksc_to_unicode(csconvert* obj,
USHORT wide; USHORT wide;
USHORT this_len; USHORT this_len;
const USHORT* const start = dest_ptr; const USHORT* const start = dest_ptr;
while ((src_len) && (dest_len > 1)) { while (src_len && (dest_len > 1)) {
if (*src_ptr & 0x80) { if (*src_ptr & 0x80) {
const UCHAR c1 = *src_ptr++; const UCHAR c1 = *src_ptr++;
@ -88,12 +88,11 @@ ULONG CVKSC_ksc_to_unicode(csconvert* obj,
} }
} }
else { /* it is ASCII */ else { /* it is ASCII */
wide = *src_ptr++; wide = *src_ptr++;
this_len = 1; this_len = 1;
} }
/* Convert from KSC to UNICODE */ // Convert from KSC to UNICODE
const USHORT ch = ((const USHORT*) impl->csconvert_datatable) const USHORT ch = ((const USHORT*) impl->csconvert_datatable)
[((const USHORT*) impl->csconvert_misc)[(USHORT) wide / 256] + (wide % 256)]; [((const USHORT*) impl->csconvert_misc)[(USHORT) wide / 256] + (wide % 256)];
@ -136,7 +135,7 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj,
const ULONG src_start = unicode_len; const ULONG src_start = unicode_len;
*err_code = 0; *err_code = 0;
/* See if we're only after a length estimate */ // See if we're only after a length estimate
if (ksc_str == NULL) if (ksc_str == NULL)
return (unicode_len); return (unicode_len);
@ -148,7 +147,7 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj,
const USHORT wide = *unicode_str++; const USHORT wide = *unicode_str++;
const USHORT ksc_ch = ((const USHORT*) impl->csconvert_datatable) const USHORT ksc_ch = ((const USHORT*) impl->csconvert_datatable)
[((const USHORT*) impl->csconvert_misc)[(USHORT)wide / 256] + (wide % 256)]; [((const USHORT*) impl->csconvert_misc)[(USHORT) wide / 256] + (wide % 256)];
if ((ksc_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) { if ((ksc_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) {
*err_code = CS_CONVERT_ERROR; *err_code = CS_CONVERT_ERROR;
break; break;
@ -158,8 +157,8 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj,
const int tmp2 = ksc_ch % 256; const int tmp2 = ksc_ch % 256;
if (tmp1 == 0) { /* ASCII character */ if (tmp1 == 0) { /* ASCII character */
fb_assert((UCHAR(tmp2)&0x80)==0); fb_assert((UCHAR(tmp2) & 0x80) == 0);
*ksc_str++ = tmp2; *ksc_str++ = tmp2;
ksc_len--; ksc_len--;
unicode_len -= sizeof(*unicode_str); unicode_len -= sizeof(*unicode_str);