--- psiconv/trunk/program/psiconv/general.c 2004/02/21 13:24:04 216 +++ psiconv/trunk/program/psiconv/general.c 2004/02/22 22:24:39 217 @@ -33,7 +33,9 @@ psiconv_ucs2 character, encoding enc) { psiconv_u8 temp; - int res; + psiconv_u8 *byteptr; + int res,i; + psiconv_buffer buf; #define TEMPSTR_LEN 80 char tempstr[TEMPSTR_LEN]; @@ -106,11 +108,22 @@ } } } else if (enc == ENCODING_PSION) { - temp = psiconv_unicode_to_char(config,character); - if ((res = psiconv_list_add(list,&temp))) { + if (!(buf = psiconv_buffer_new())) { + fputs("Out of memory error\n",stderr); + exit(1); + } + psiconv_unicode_write_char(config,buf,0,character); + for (i = 0; i < psiconv_buffer_length(buf); i++) { + if (!(byteptr = psiconv_buffer_get(buf,i))) { + fputs("Internal memory corruption\n",stderr); + exit(1); + } + if ((res = psiconv_list_add(list,byteptr))) { fputs("Out of memory error\n",stderr); exit(1); } + } + psiconv_buffer_free(buf); } }