From 7e00f2c83dd512d9caf13bfbdbec55f2b3eb2790 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Fri, 25 Apr 2025 18:27:30 -0700
Subject: [PATCH] Create FTN charset of "ASCII 1" when the imported message is
 explicitly ASCII

(e.g. via "Content-Type: text/plain; charset=US-ASCII" header field)

... previously we would default to "CP437" for the created FTN charset.
---
 src/sbbs3/qwktomsg.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/sbbs3/qwktomsg.cpp b/src/sbbs3/qwktomsg.cpp
index 6fc3ef0497..5533e85210 100644
--- a/src/sbbs3/qwktomsg.cpp
+++ b/src/sbbs3/qwktomsg.cpp
@@ -484,6 +484,8 @@ bool sbbs_t::qwk_import_msg(FILE *qwk_fp, char *hdrblk, uint blocks
 		const char* charset = FIDO_CHARSET_CP437;
 		if (msg->hdr.auxattr & MSG_HFIELDS_UTF8)
 			charset = FIDO_CHARSET_UTF8;
+		else if (smb_msg_is_ascii(msg) && str_is_ascii(body) && str_is_ascii(tail))
+			charset = FIDO_CHARSET_ASCII;
 		smb_hfield_str(msg, FIDOCHARSET, charset);
 	}
 
-- 
GitLab