24 #if defined(F_isSpecialSJIS) || defined(F_isSpecialASCII)
25 static const struct charmap_t sjis_conversion[] = {
62 #ifdef F_isSpecialSJIS
63 unsigned char isSpecialSJIS(
short sjis)
65 const struct charmap_t *s = &sjis_conversion[0];
67 if (s->sjis == sjis)
return s->ascii;
69 }
while (s->sjis != 0);
73 unsigned char isSpecialSJIS(
short sjis);
76 #ifdef F_isSpecialASCII
77 short isSpecialASCII(
unsigned char ascii)
79 const struct charmap_t *s = &sjis_conversion[0];
81 if (s->ascii == ascii)
return s->sjis;
83 }
while (s->ascii != 0);
87 short isSpecialASCII(
unsigned char ascii);
91 int strcpy_ascii(
char* ascii_buff,
const short* sjis_buff)
95 int len = strlen((
const char *)sjis_buff)/2;
100 if ((ascii = isSpecialSJIS(sjis)) != 0) {
102 ascii = ((sjis & 0xFF00) >> 8) - 0x1f;
103 if (ascii>96) ascii--;
105 ascii_buff[i] = ascii;
113 int strcpy_sjis(
short* sjis_buff,
const char* ascii_buff)
117 int len = strlen(ascii_buff);
119 for (i=0;i<len;i++) {
121 ascii = ascii_buff[i];
122 if ((sjis = isSpecialASCII(ascii)) != 0) {
124 if (ascii>96) ascii++;
125 sjis = ((ascii + 0x1f) << 8) | 0x82;