{
int s, n;
- s = -1;
- n = cp1251_ucs_table_len-1;
- while (n >= 0) {
- if (c == cp1251_ucs_table[n]) {
- s = cp1251_ucs_table_min + n;
- break;
+ if (c < 0x80) {
+ s = c;
+ } else {
+ s = -1;
+ n = cp1251_ucs_table_len-1;
+ while (n >= 0) {
+ if (c == cp1251_ucs_table[n]) {
+ s = cp1251_ucs_table_min + n;
+ break;
+ }
+ n--;
+ }
+ if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP1251) {
+ s = c & MBFL_WCSPLANE_MASK;
}
- n--;
- }
- if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP1251) {
- s = c & MBFL_WCSPLANE_MASK;
}
if (s >= 0) {
{
int s, n;
- s = -1;
- n = cp866_ucs_table_len-1;
- while (n >= 0) {
- if (c == cp866_ucs_table[n]) {
- s = cp866_ucs_table_min + n;
- break;
+ if (c < 0x80) {
+ s = c;
+ } else {
+ s = -1;
+ n = cp866_ucs_table_len-1;
+ while (n >= 0) {
+ if (c == cp866_ucs_table[n]) {
+ s = cp866_ucs_table_min + n;
+ break;
+ }
+ n--;
+ }
+ if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP866) {
+ s = c & MBFL_WCSPLANE_MASK;
}
- n--;
- }
- if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP866) {
- s = c & MBFL_WCSPLANE_MASK;
}
if (s >= 0) {
{
int s, n;
- s = -1;
- n = koi8r_ucs_table_len-1;
- while (n >= 0) {
- if (c == koi8r_ucs_table[n]) {
- s = koi8r_ucs_table_min + n;
- break;
+ if (c < 0x80) {
+ s = c;
+ } else {
+ s = -1;
+ n = koi8r_ucs_table_len-1;
+ while (n >= 0) {
+ if (c == koi8r_ucs_table[n]) {
+ s = koi8r_ucs_table_min + n;
+ break;
+ }
+ n--;
+ }
+ if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_KOI8R) {
+ s = c & MBFL_WCSPLANE_MASK;
}
- n--;
- }
- if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_KOI8R) {
- s = c & MBFL_WCSPLANE_MASK;
}
if (s >= 0) {