int
mbfl_filt_conv_wchar_jis_ms(int c, mbfl_convert_filter *filter)
{
- int c1, s;
+ int s = 0;
- s = 0;
if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) {
s = ucs_a1_jis_table[c - ucs_a1_jis_table_min];
} else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) {
/* do some transliteration */
if (s <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_JIS0212) {
- s = c & MBFL_WCSPLANE_MASK;
- s |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s = 0x1005c;
} else if (c == 0x203e) { /* OVER LINE */
s = 0x1007e;
}
if (s1 >= 0x8080) s1 = -1; /* we don't support JIS X0213 */
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- if (s1 >= ((85 + 0x20) << 8)) { /* 85ku - 120ku */
- s1 = -1;
- }
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x005c; /* YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x007e; /* FULLWIDTH MACRON */
s2 = 1;
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s2 = 1;
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s1 |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x005c; /* YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x007e; /* FULLWIDTH MACRON */
int
mbfl_filt_conv_wchar_eucjp(int c, mbfl_convert_filter *filter)
{
- int s;
+ int s = 0;
- s = 0;
if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) {
s = ucs_a1_jis_table[c - ucs_a1_jis_table_min];
} else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) {
s1 = 0x2d62; /* NUMERO SIGN */
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- if (s1 >= ((85 + 0x20) << 8)) { /* 85ku - 120ku */
- s1 = -1;
- }
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- if (s1 >= ((83 + 0x20) << 8)) { /* 83ku - 94ku */
- s1 = -1;
- } else {
- s1 |= 0x8080;
- }
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x216f; /* FULLWIDTH YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x2131; /* FULLWIDTH MACRON */
s1 = (c1 << 8) | c2;
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s2 = 1;
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s1 |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x216f; /* FULLWIDTH YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x2131; /* FULLWIDTH MACRON */
s1 = (c1 << 8) | c2;
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s2 = 1;
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s1 |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x216f; /* FULLWIDTH YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x2131; /* FULLWIDTH MACRON */
int
mbfl_filt_conv_wchar_jis(int c, mbfl_convert_filter *filter)
{
- int c1, s;
+ int s = 0;
- s = 0;
if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) {
s = ucs_a1_jis_table[c - ucs_a1_jis_table_min];
} else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) {
s = ucs_r_jis_table[c - ucs_r_jis_table_min];
}
if (s <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_JIS0212) {
- s = c & MBFL_WCSPLANE_MASK;
- s |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s = 0x1005c;
} else if (c == 0x203e) { /* OVER LINE */
s = 0x1007e;
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_JIS0213) {
- s1 = c & MBFL_WCSPLANE_MASK;
- }
if (c == 0) {
s1 = 0;
} else if (s1 <= 0) {
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s2 = 1;
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s1 |= 0x8080;
- } else if (c == 0xa0) {
+ if (c == 0xa0) {
s1 = 0x00a0;
} else if (c == 0xa5) { /* YEN SIGN */
/* Unicode has codepoint 0xFFE5 for a fullwidth Yen sign;
s2 = 1;
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s2 = 1;
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s1 |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x216f; /* FULLWIDTH YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x2131; /* FULLWIDTH MACRON */
s2 = 1;
}
if (s1 <= 0) {
- c1 = c & ~MBFL_WCSPLANE_MASK;
- if (c1 == MBFL_WCSPLANE_WINCP932) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s2 = 1;
- } else if (c1 == MBFL_WCSPLANE_JIS0212) {
- s1 = c & MBFL_WCSPLANE_MASK;
- s1 |= 0x8080;
- } else if (c == 0xa5) { /* YEN SIGN */
+ if (c == 0xa5) { /* YEN SIGN */
s1 = 0x216f; /* FULLWIDTH YEN SIGN */
} else if (c == 0x203e) { /* OVER LINE */
s1 = 0x2131; /* FULLWIDTH MACRON */