… | |
… | |
32 | void output_char(psiconv_config config, psiconv_list list, |
32 | void output_char(psiconv_config config, psiconv_list list, |
33 | psiconv_ucs2 character, encoding enc) |
33 | psiconv_ucs2 character, encoding enc) |
34 | { |
34 | { |
35 | psiconv_u8 temp; |
35 | psiconv_u8 temp; |
36 | int res; |
36 | int res; |
|
|
37 | #define TEMPSTR_LEN 80 |
|
|
38 | char tempstr[TEMPSTR_LEN]; |
37 | |
39 | |
38 | if (enc == ENCODING_UCS2) { |
40 | if (enc == ENCODING_UCS2) { |
39 | temp = character >> 8; |
41 | temp = character >> 8; |
40 | if ((res = psiconv_list_add(list,&temp))) { |
42 | if ((res = psiconv_list_add(list,&temp))) { |
41 | fputs("Out of memory error\n",stderr); |
43 | fputs("Out of memory error\n",stderr); |
… | |
… | |
90 | temp = character; |
92 | temp = character; |
91 | if ((res = psiconv_list_add(list,&temp))) { |
93 | if ((res = psiconv_list_add(list,&temp))) { |
92 | fputs("Out of memory error\n",stderr); |
94 | fputs("Out of memory error\n",stderr); |
93 | exit(1); |
95 | exit(1); |
94 | } |
96 | } |
|
|
97 | } else if (enc == ENCODING_ASCII_HTML) { |
|
|
98 | if (character >= 0x80) { |
|
|
99 | snprintf(tempstr,TEMPSTR_LEN,"&#x%x;",character); |
|
|
100 | output_simple_chars(config,list,tempstr,enc); |
|
|
101 | } else { |
|
|
102 | temp = character; |
|
|
103 | if ((res = psiconv_list_add(list,&temp))) { |
|
|
104 | fputs("Out of memory error\n",stderr); |
|
|
105 | exit(1); |
|
|
106 | } |
|
|
107 | } |
95 | } else if (enc == ENCODING_PSION) { |
108 | } else if (enc == ENCODING_PSION) { |
96 | temp = psiconv_unicode_to_char(config,character); |
109 | temp = psiconv_unicode_to_char(config,character); |
97 | if ((res = psiconv_list_add(list,&temp))) { |
110 | if ((res = psiconv_list_add(list,&temp))) { |
98 | fputs("Out of memory error\n",stderr); |
111 | fputs("Out of memory error\n",stderr); |
99 | exit(1); |
112 | exit(1); |