From 5617b0f2ae4e9bcd500078cc653f2904917f23ce Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 2 Aug 2019 08:31:15 +0000
Subject: [PATCH] If SBBSecho imports a message with a "CHRS" control line with
 a value of "UTF-8", set the msg's auxattr MSG_HFIELDS_UTF8 flag because
 FTS-5003 states:   "The character set identifier applies to all parts of the
 message,    including the header information and the control lines like
 origin    and tear line."

---
 src/sbbs3/sbbsecho.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/sbbsecho.c b/src/sbbs3/sbbsecho.c
index 00737643c6..c4ac492af6 100644
--- a/src/sbbs3/sbbsecho.c
+++ b/src/sbbs3/sbbsecho.c
@@ -3506,8 +3506,11 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
 				m=l;
 				while(m<length && fbuf[m]!='\r') m++;
 				while(m && fbuf[m-1]<=' ' && fbuf[m-1]>=0) m--;
-				if(m>l)
+				if(m>l) {
 					smb_hfield(&msg, FIDOCHARSET, (ushort)(m-l), fbuf+l);
+					if(smb_msg_is_utf8(&msg))
+						msg.hdr.auxattr |= MSG_HFIELDS_UTF8;
+				}
 			}
 
 			else if(!strncmp((char *)fbuf+l+1, "CHARSET:", 8)) {
-- 
GitLab