#include #include #include"chat.h" int decode(str,henkanmode) char *str; int henkanmode; /* 1: to JIS 2: to EUC 3: to SJIS 0: not convert*/ { int i,len,c; char buf[MAX_MESSAGE],hex[5]; unsigned char ch; int ret = NORMAL; len = strlen(str); if(len > MAX_MESSAGE-1){ len = MAX_MESSAGE-1; } strncpy(buf, str, len+1); c=0; for(i=0 ; i'){ sprintf(&str[c], ">"); c += 4;continue; } #endif if(ch != 13 && ch != 10){ str[c]=ch; c++; }else{ sprintf(&str[c], " "); /*str[c] = '\0';*/ c++; /* c += 4;*/ } } str[c] = '\0'; if( henkanmode != NOT_CNVT){ jc(str,henkanmode);/* KANJI CODE CONVERT */ } return(ret); }