Skip to content
Snippets Groups Projects
Commit f754ad90 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow UTF-8 sequences in message subjects (passing K_UTF8 to getstr)

This was the behavior for all string input in SBBS until recently
(Commit 55ccda62), with this change, an exception is being
made for message subjects, but the vast majority of other string
input is still limited to single-byte (i.e. US-ASCII or CP437)
characters.

This should fix issue #720
parent 375bdb78
No related branches found
No related tags found
No related merge requests found
Pipeline #5896 passed
...@@ -511,7 +511,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, int mode, ...@@ -511,7 +511,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, int mode,
max_title_len = LEN_TITLE; max_title_len = LEN_TITLE;
if(draft_restored) if(draft_restored)
user_get_property(&cfg, useron.number, draft_desc, "subject", subj, max_title_len); user_get_property(&cfg, useron.number, draft_desc, "subject", subj, max_title_len);
if(!getstr(subj,max_title_len,mode&WM_FILE ? K_LINE|K_TRIM : K_LINE|K_EDIT|K_AUTODEL|K_TRIM) if(!getstr(subj,max_title_len,mode&WM_FILE ? K_LINE|K_TRIM : K_LINE|K_EDIT|K_AUTODEL|K_TRIM|K_UTF8)
&& useron_level && useron.logons) { && useron_level && useron.logons) {
free(buf); free(buf);
return(false); return(false);
...@@ -1158,7 +1158,7 @@ uint sbbs_t::msgeditor(char *buf, const char *top, char *title, uint maxlines, u ...@@ -1158,7 +1158,7 @@ uint sbbs_t::msgeditor(char *buf, const char *top, char *title, uint maxlines, u
else if(!stricmp(strin,"/T")) { /* Edit title/subject */ else if(!stricmp(strin,"/T")) { /* Edit title/subject */
if(title != nulstr) { // hack if(title != nulstr) { // hack
bputs(text[SubjectPrompt]); bputs(text[SubjectPrompt]);
getstr(title,LEN_TITLE,K_LINE|K_EDIT|K_AUTODEL|K_TRIM); getstr(title,LEN_TITLE,K_LINE|K_EDIT|K_AUTODEL|K_TRIM|K_UTF8);
sync(); sync();
CRLF; CRLF;
} }
...@@ -1449,7 +1449,7 @@ bool sbbs_t::forwardmsg(smb_t* smb, smbmsg_t* orgmsg, const char* to, const char ...@@ -1449,7 +1449,7 @@ bool sbbs_t::forwardmsg(smb_t* smb, smbmsg_t* orgmsg, const char* to, const char
else { else {
SAFEPRINTF(subj, "Fwd: %s", orgmsg->subj); SAFEPRINTF(subj, "Fwd: %s", orgmsg->subj);
bputs(text[SubjectPrompt]); bputs(text[SubjectPrompt]);
if(!getstr(subj, sizeof(subj) - 1, K_LINE | K_EDIT | K_AUTODEL | K_TRIM)) if(!getstr(subj, sizeof(subj) - 1, K_LINE | K_EDIT | K_AUTODEL | K_TRIM | K_UTF8))
return false; return false;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment