Commits (1)
......@@ -155,7 +155,7 @@ const char* sbbs_t::msghdr_field(const smbmsg_t* msg, const char* str, char* buf
buf = msgghdr_field_cp437_str;
strncpy(buf, str, sizeof(msgghdr_field_cp437_str) - 1);
utf8_to_cp437_str(buf);
utf8_to_cp437_inplace(buf);
return buf;
}
......
......@@ -4568,7 +4568,7 @@ js_utf8_decode(JSContext *cx, uintN argc, jsval *arglist)
return JS_TRUE;
rc=JS_SUSPENDREQUEST(cx);
utf8_to_cp437_str(buf);
utf8_to_cp437_inplace(buf);
JS_RESUMEREQUEST(cx, rc);
js_str = JS_NewStringCopyZ(cx, buf);
......
......@@ -4012,7 +4012,7 @@ static void smtp_thread(void* arg)
,timestr(&scfg,newmsg.hdr.when_imported.time,tmp)
,sender, p);
if(newmsg.hdr.auxattr&MSG_HFIELDS_UTF8)
utf8_to_cp437_str(str);
utf8_to_cp437_inplace(str);
if(!newmsg.idx.to) /* Forwarding */
sprintf(str+strlen(str), startup->forward_notice, rcpt_addr);
putsmsg(&scfg, usernum, str);
......
......@@ -251,7 +251,7 @@ long sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, smb_t* smb
if(mode&QM_UTF8)
qwk_newline = '\n';
else
utf8_to_cp437_str(buf);
utf8_to_cp437_inplace(buf);
}
fprintf(qwk_fp,"%*s",QWK_BLOCK_LEN,""); /* Init header to space */
......
......@@ -870,7 +870,7 @@ uint32_t str_to_bits(uint32_t val, const char *str)
}
/* Convert a UTF-8 encoded string to a CP437-encoded string */
char* utf8_to_cp437_str(char* str)
char* utf8_to_cp437_inplace(char* str)
{
utf8_normalize_str(str);
return utf8_replace_chars(str, unicode_to_cp437
......
......@@ -67,7 +67,7 @@ DLLEXPORT char * rot13(char* str);
DLLEXPORT uint32_t str_to_bits(uint32_t currval, const char *str);
DLLEXPORT BOOL str_has_ctrl(const char*);
DLLEXPORT BOOL str_is_ascii(const char*);
DLLEXPORT char * utf8_to_cp437_str(char* str);
DLLEXPORT char * utf8_to_cp437_inplace(char* str);
DLLEXPORT char * sub_newsgroup_name(scfg_t*, sub_t*, char*, size_t);
DLLEXPORT char * sub_area_tag(scfg_t*, sub_t*, char*, size_t);
DLLEXPORT char * dir_area_tag(scfg_t*, dir_t*, char*, size_t);
......
......@@ -101,7 +101,7 @@ bool sbbs_t::quotemsg(smb_t* smb, smbmsg_t* msg, bool tails)
&& (!useron_xedit || (cfg.xedit[useron_xedit-1]->misc&XTRN_UTF8)))
is_utf8 = TRUE;
else {
utf8_to_cp437_str(buf);
utf8_to_cp437_inplace(buf);
}
} else { // CP437
char* orgtxt;
......@@ -559,7 +559,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode,
if(!str_is_ascii(subj)) {
if(utf8_str_is_valid(subj)) {
if(!term_supports(UTF8) || !(cfg.xedit[useron_xedit-1]->misc & XTRN_UTF8)) {
utf8_to_cp437_str(subj);
utf8_to_cp437_inplace(subj);
}
} else { // CP437
if(term_supports(UTF8) && (cfg.xedit[useron_xedit-1]->misc & XTRN_UTF8)) {
......