24#if defined(F_isSpecialSJIS) || defined(F_isSpecialASCII)
25static struct charmap_t sjis_conversion[] = {
63unsigned char isSpecialSJIS(
short sjis)
65 struct charmap_t *s = &sjis_conversion[0];
67 if (s->sjis == sjis)
return s->ascii;
69 }
while (s->sjis != 0);
73unsigned char isSpecialSJIS(
short sjis);
76#ifdef F_isSpecialASCII
77short isSpecialASCII(
unsigned char ascii)
79 struct charmap_t *s = &sjis_conversion[0];
81 if (s->ascii == ascii)
return s->sjis;
83 }
while (s->ascii != 0);
87short isSpecialASCII(
unsigned char ascii);
91int 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;
113int 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;
int strcpy_ascii(char *ascii_buff, const short *sjis_buff)
int strcpy_sjis(short *sjis_buff, const char *ascii_buff)