Community Discussions and Support
Long UTF-8 clobbered in message properties

Did some more work (more google ai).


Modified program to create a log file when the emoji characters are removed.
Test message with emoji created this


/PMAIL/MAIL$ cat stripped_utf8.log 
[2026-11-28 04:25:29] TEST3.CNM
UTF-8 : Test Email
Clean : Test Email

Didn't let post for emojis on UTF-8 line???


Also windows bat version of script?
cat fixutf8.bat (if mult-user would need to add username after \MAIL
@echo off
cd /d "C:\PMAIL\MAIL"
for %%a in (*.CNM) do (
findstr /i /c:"Subject: =?UTF-8" "%%a" >nul
if not errorlevel 1 stripchar2.exe "%%a"
)

Also, says Pegasus is decoding the mime, before filter, and that is why it wasn't running rule looking for utf-8


Says another option might work that looks at raw headers?


Also, had option that would add the run program from toolbar but didn't try it yet.


Did some more work (more google ai). Modified program to create a log file when the emoji characters are removed. Test message with emoji created this ```` /PMAIL/MAIL$ cat stripped_utf8.log [2026-11-28 04:25:29] TEST3.CNM UTF-8 : Test Email Clean : Test Email ```` Didn't let post for emojis on UTF-8 line??? Also windows bat version of script? cat fixutf8.bat (if mult-user would need to add username after \MAIL @echo off cd /d "C:\PMAIL\MAIL" for %%a in (*.CNM) do ( findstr /i /c:"Subject: =?UTF-8" "%%a" >nul if not errorlevel 1 stripchar2.exe "%%a" ) Also, says Pegasus is decoding the mime, before filter, and that is why it wasn't running rule looking for utf-8 Says another option might work that looks at raw headers? Also, had option that would add the run program from toolbar but didn't try it yet.

mikes@guam.net

New Version...


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>

#define MAX_HDR_BUF 65536

static int hex_val(char c) {
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'A' && c <= 'F') return c - 'A' + 10;
if (c >= 'a' && c <= 'f') return c - 'a' + 10;
return -1;
}

static int b64_val(char c) {
if (c >= 'A' && c <= 'Z') return c - 'A';
if (c >= 'a' && c <= 'z') return c - 'a' + 26;
if (c >= '0' && c <= '9') return c - '0' + 52;
if (c == '+') return 62;
if (c == '/') return 63;
return -1;
}

static size_t decode_qp(const char *src, size_t len, unsigned char *dst) {
size_t out = 0;
for (size_t i = 0; i < len; i++) {
if (src[i] == '_') {
dst[out++] = ' ';
} else if (src[i] == '=' && i + 2 < len) {
int h1 = hex_val(src[i + 1]);
int h2 = hex_val(src[i + 2]);
if (h1 >= 0 && h2 >= 0) {
dst[out++] = (unsigned char)((h1 << 4) | h2);
i += 2;
} else {
dst[out++] = (unsigned char)src[i];
}
} else {
dst[out++] = (unsigned char)src[i];
}
}
return out;
}

static size_t decode_b64(const char *src, size_t len, unsigned char *dst) {
size_t out = 0;
int val = 0, bits = -8;
for (size_t i = 0; i < len; i++) {
if (src[i] == '=') break;
int d = b64_val(src[i]);
if (d < 0) continue;
val = (val << 6) | d;
bits += 6;
if (bits >= 0) {
dst[out++] = (unsigned char)((val >> bits) & 0xFF);
bits -= 8;
}
}
return out;
}

static int starts_with_ci(const char *s, const char *prefix) {
while (*prefix) {
if (tolower((unsigned char)*s) != tolower((unsigned char)*prefix)) return 0;
s++;
prefix++;
}
return 1;
}

/* Map UTF-8 0xC3 xx Latin-1 Supplement accented letters to base ASCII */
static char map_latin1_c3(unsigned char b2) {
if (b2 >= 0x80 && b2 <= 0x85) return 'A';
if (b2 == 0x87) return 'C';
if (b2 >= 0x88 && b2 <= 0x8B) return 'E';
if (b2 >= 0x8C && b2 <= 0x8F) return 'I';
if (b2 == 0x91) return 'N';
if (b2 >= 0x92 && b2 <= 0x96) return 'O';
if (b2 >= 0x99 && b2 <= 0x9C) return 'U';
if (b2 == 0x9D) return 'Y';

if (b2 >= 0xA0 && b2 <= 0xA5) return 'a';
if (b2 == 0xA7) return 'c';
if (b2 >= 0xA8 && b2 <= 0xAB) return 'e';
if (b2 >= 0xAC && b2 <= 0xAF) return 'i';
if (b2 == 0xB1) return 'n';
if (b2 >= 0xB2 && b2 <= 0xB6) return 'o';
if (b2 >= 0xB9 && b2 <= 0xBC) return 'u';
if (b2 == 0xBD || b2 == 0xBF) return 'y';

return 0;
}

/* Append decoded UTF-8 bytes into clean ASCII out AND raw decoded UTF-8 out.
Sets *had_stripped = 1 if any character was dropped instead of transliterated. */

static void process_utf8_chunk(
const unsigned char *src, size_t slen,
char *out_clean, size_t *oi_clean, size_t clean_max,
char *out_utf8, size_t *oi_utf8, size_t utf8_max,
int *had_stripped
)
{
size_t k = 0;
while (k < slen && *oi_clean + 1 < clean_max) {
unsigned char b1 = src[k];
if (b1 < 0x80) {
if (b1 >= 0x20 && b1 <= 0x7E) {
out_clean[(*oi_clean)++] = (char)b1;
if (*oi_utf8 + 1 < utf8_max) out_utf8[(*oi_utf8)++] = (char)b1;
}
k++;
} else if ((b1 & 0xE0) == 0xC0 && k + 1 < slen) {
/* Copy original 2-byte UTF-8 to decoded log buffer */
if (*oi_utf8 + 2 < utf8_max) {
out_utf8[(*oi_utf8)++] = (char)src[k];
out_utf8[(*oi_utf8)++] = (char)src[k + 1];
}

if (b1 == 0xC3) {
char mapped = map_latin1_c3(src[k + 1]);
if (mapped) {
out_clean[(*oi_clean)++] = mapped;
} else {
*had_stripped = 1;
}
} else if (b1 == 0xC2 && src[k + 1] == 0xA0) {
/* Non-breaking space -> regular space */
out_clean[(*oi_clean)++] = ' ';
} else {
*had_stripped = 1;
}
k += 2;
} else if ((b1 & 0xF0) == 0xE0 && k + 2 < slen) {
/* Copy original 3-byte UTF-8 to decoded log buffer */
if (*oi_utf8 + 3 < utf8_max) {
out_utf8[(*oi_utf8)++] = (char)src[k];
out_utf8[(*oi_utf8)++] = (char)src[k + 1];
out_utf8[(*oi_utf8)++] = (char)src[k + 2];
}

/* Common 3-byte smart punctuation (0xE2 0x80 xx) */
if (b1 == 0xE2 && src[k + 1] == 0x80) {
unsigned char b3 = src[k + 2];
if (b3 == 0x93 || b3 == 0x94) {
out_clean[(*oi_clean)++] = '-';
} else if (b3 == 0x98 || b3 == 0x99) {
out_clean[(*oi_clean)++] = '\'';
} else if (b3 == 0x9C || b3 == 0x9D) {
out_clean[(*oi_clean)++] = '"';
} else if (b3 == 0xA6 && *oi_clean + 3 < clean_max) {
out_clean[(*oi_clean)++] = '.';
out_clean[(*oi_clean)++] = '.';
out_clean[(*oi_clean)++] = '.';
} else {
*had_stripped = 1;
}
} else {
*had_stripped = 1;
}
k += 3;
} else if ((b1 & 0xF8) == 0xF0 && k + 3 < slen) {
/* Copy original 4-byte UTF-8 (emojis) to decoded log buffer */
if (*oi_utf8 + 4 < utf8_max) {
out_utf8[(*oi_utf8)++] = (char)src[k];
out_utf8[(*oi_utf8)++] = (char)src[k + 1];
out_utf8[(*oi_utf8)++] = (char)src[k + 2];
out_utf8[(*oi_utf8)++] = (char)src[k + 3];
}
*had_stripped = 1;
k += 4;
} else {
/* Stray/invalid byte -> skip */
k++;
}
}
}

static int clean_subject_value(
const char *in,
char *out_clean, size_t clean_max,
char *out_utf8, size_t utf8_max
)
{
size_t oi_clean = 0;
size_t oi_utf8 = 0;
const char *p = in;
int prev_was_encoded = 0;
int had_stripped = 0;

while (*p && oi_clean + 1 < clean_max) {
if (p[0] == '=' && p[1] == '?') {
const char *q1 = strchr(p + 2, '?');
if (q1 && (q1[1] == 'Q' || q1[1] == 'q' || q1[1] == 'B' || q1[1] == 'b') && q1[2] == '?') {
char enc = (char)toupper((unsigned char)q1[1]);
const char *payload = q1 + 3;
const char *end = strstr(payload, "?=");
if (end) {
/* Strip inter-word whitespace between adjacent encoded words */
if (prev_was_encoded) {
while (oi_clean > 0 && (out_clean[oi_clean - 1] == ' ' || out_clean[oi_clean - 1] == '\t')) {
oi_clean--;
}
while (oi_utf8 > 0 && (out_utf8[oi_utf8 - 1] == ' ' || out_utf8[oi_utf8 - 1] == '\t')) {
oi_utf8--;
}
}

size_t plen = (size_t)(end - payload);
unsigned char *tmp = (unsigned char *)malloc(plen + 4);
if (tmp) {
size_t dlen = (enc == 'Q')
? decode_qp(payload, plen, tmp)
: decode_b64(payload, plen, tmp);

process_utf8_chunk(
tmp, dlen,
out_clean, &oi_clean, clean_max,
out_utf8, &oi_utf8, utf8_max,
&had_stripped
);
free(tmp);
}
p = end + 2;
prev_was_encoded = 1;
continue;
}
}
}

unsigned char ch = (unsigned char)*p;
if (ch != ' ' && ch != '\t') {
prev_was_encoded = 0;
}

if (ch < 0x80) {
if (ch >= 0x20 && ch <= 0x7E) {
out_clean[oi_clean++] = (char)ch;
if (oi_utf8 + 1 < utf8_max) out_utf8[oi_utf8++] = (char)ch;
}
p++;
} else {
/* Handle unencoded 8-bit UTF-8 sequences directly in the Subject header */
size_t avail = strlen(p);
size_t seq_len = 1;
if ((ch & 0xE0) == 0xC0 && avail >= 2) seq_len = 2;
else if ((ch & 0xF0) == 0xE0 && avail >= 3) seq_len = 3;
else if ((ch & 0xF8) == 0xF0 && avail >= 4) seq_len = 4;

process_utf8_chunk(
(const unsigned char *)p, seq_len,
out_clean, &oi_clean, clean_max,
out_utf8, &oi_utf8, utf8_max,
&had_stripped
);
p += seq_len;
}
}

while (oi_clean > 0 && (out_clean[oi_clean - 1] == ' ' || out_clean[oi_clean - 1] == '\t')) {
oi_clean--;
}
out_clean[oi_clean] = '\0';

while (oi_utf8 > 0 && (out_utf8[oi_utf8 - 1] == ' ' || out_utf8[oi_utf8 - 1] == '\t')) {
oi_utf8--;
}
out_utf8[oi_utf8] = '\0';

return had_stripped;
}

static void log_stripped_subject(const char *msg_path, const char *custom_log, const char *utf8_subj, const char *clean_subj) {
char log_path[1024];
if (custom_log && custom_log[0] != '\0') {
snprintf(log_path, sizeof(log_path), "%s", custom_log);
} else {
/* Place stripped_utf8.log in the same directory as the .CNM file */
snprintf(log_path, sizeof(log_path), "%s", msg_path);
char *slash1 = strrchr(log_path, '/');
char *slash2 = strrchr(log_path, '\\');
char *last_slash = (slash1 > slash2) ? slash1 : slash2;
if (last_slash) {
*(last_slash + 1) = '\0';
strncat(log_path, "stripped_utf8.log", sizeof(log_path) - strlen(log_path) - 1);
} else {
snprintf(log_path, sizeof(log_path), "stripped_utf8.log");
}
}

FILE *flog = fopen(log_path, "ab");
if (!flog) return;

time_t now = time(NULL);
struct tm *tm_info = localtime(&now);
char ts[32] = "0000-00-00 00:00:00";
if (tm_info) {
strftime(ts, sizeof(ts), "%Y-%m-%d %H:%M:%S", tm_info);
}

/* Extract just the filename for cleaner log entries */
const char *fname = msg_path;
const char *s1 = strrchr(msg_path, '/');
const char *s2 = strrchr(msg_path, '\\');
if (s1 || s2) {
fname = ((s1 > s2) ? s1 : s2) + 1;
}

fprintf(flog, "[%s] %s\n UTF-8 : %s\n Clean : %s\n\n", ts, fname, utf8_subj, clean_subj);
fclose(flog);
}

int main(int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: %s <message.cnm> [logfile]\n", argv[0]);
return 1;
}

const char *path = argv[1];
const char *custom_log = (argc >= 3) ? argv[2] : NULL;

FILE *fin = fopen(path, "rb");
if (!fin) return 1;

char tmp_path[1024];
snprintf(tmp_path, sizeof(tmp_path), "%s.tmp", path);
FILE *fout = fopen(tmp_path, "wb");
if (!fout) {
fclose(fin);
return 1;
}

char line[8192];
char subj_raw[MAX_HDR_BUF];
char subj_clean[MAX_HDR_BUF];
char subj_utf8[MAX_HDR_BUF];
int in_subject = 0;
int headers_done = 0;
int detected_crlf = 1;

while (fgets(line, sizeof(line), fin)) {
if (!headers_done) {
size_t len = strlen(line);
int has_crlf = (len >= 2 && line[len - 2] == '\r' && line[len - 1] == '\n');
if (len >= 1) detected_crlf = has_crlf;

while (len > 0 && (line[len - 1] == '\r' || line[len - 1] == '\n')) {
line[--len] = '\0';
}

if (in_subject) {
if (len > 0 && (line[0] == ' ' || line[0] == '\t')) {
const char *cont = line;
while (*cont == ' ' || *cont == '\t') cont++;
size_t cur = strlen(subj_raw);
if (cur + strlen(cont) + 2 < sizeof(subj_raw)) {
if (cur > 0) strcat(subj_raw, " ");
strcat(subj_raw, cont);
}
continue;
} else {
int had_stripped = clean_subject_value(
subj_raw,
subj_clean, sizeof(subj_clean),
subj_utf8, sizeof(subj_utf8)
);
if (had_stripped) {
log_stripped_subject(path, custom_log, subj_utf8, subj_clean);
}
fprintf(fout, "Subject: %s%s", subj_clean, detected_crlf ? "\r\n" : "\n");
in_subject = 0;
}
}

if (len == 0) {
headers_done = 1;
fprintf(fout, "%s", detected_crlf ? "\r\n" : "\n");
continue;
}

if (starts_with_ci(line, "Subject:")) {
const char *val = line + 8;
while (*val == ' ' || *val == '\t') val++;
snprintf(subj_raw, sizeof(subj_raw), "%s", val);
in_subject = 1;
continue;
}

fprintf(fout, "%s%s", line, has_crlf ? "\r\n" : "\n");
} else {
fwrite(line, 1, strlen(line), fout);
}
}

if (in_subject) {
int had_stripped = clean_subject_value(
subj_raw,
subj_clean, sizeof(subj_clean),
subj_utf8, sizeof(subj_utf8)
);
if (had_stripped) {
log_stripped_subject(path, custom_log, subj_utf8, subj_clean);
}
fprintf(fout, "Subject: %s%s", subj_clean, detected_crlf ? "\r\n" : "\n");
}

fclose(fin);
fclose(fout);

remove(path);
if (rename(tmp_path, path) != 0) {
return 1;
}

return 0;
}
New Version... ```` #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;ctype.h&gt; #include &lt;time.h&gt; #define MAX_HDR_BUF 65536 static int hex_val(char c) { if (c &gt;= &#039;0&#039; &amp;&amp; c &lt;= &#039;9&#039;) return c - &#039;0&#039;; if (c &gt;= &#039;A&#039; &amp;&amp; c &lt;= &#039;F&#039;) return c - &#039;A&#039; + 10; if (c &gt;= &#039;a&#039; &amp;&amp; c &lt;= &#039;f&#039;) return c - &#039;a&#039; + 10; return -1; } static int b64_val(char c) { if (c &gt;= &#039;A&#039; &amp;&amp; c &lt;= &#039;Z&#039;) return c - &#039;A&#039;; if (c &gt;= &#039;a&#039; &amp;&amp; c &lt;= &#039;z&#039;) return c - &#039;a&#039; + 26; if (c &gt;= &#039;0&#039; &amp;&amp; c &lt;= &#039;9&#039;) return c - &#039;0&#039; + 52; if (c == &#039;+&#039;) return 62; if (c == &#039;/&#039;) return 63; return -1; } static size_t decode_qp(const char *src, size_t len, unsigned char *dst) { size_t out = 0; for (size_t i = 0; i &lt; len; i++) { if (src[i] == &#039;_&#039;) { dst[out++] = &#039; &#039;; } else if (src[i] == &#039;=&#039; &amp;&amp; i + 2 &lt; len) { int h1 = hex_val(src[i + 1]); int h2 = hex_val(src[i + 2]); if (h1 &gt;= 0 &amp;&amp; h2 &gt;= 0) { dst[out++] = (unsigned char)((h1 &lt;&lt; 4) | h2); i += 2; } else { dst[out++] = (unsigned char)src[i]; } } else { dst[out++] = (unsigned char)src[i]; } } return out; } static size_t decode_b64(const char *src, size_t len, unsigned char *dst) { size_t out = 0; int val = 0, bits = -8; for (size_t i = 0; i &lt; len; i++) { if (src[i] == &#039;=&#039;) break; int d = b64_val(src[i]); if (d &lt; 0) continue; val = (val &lt;&lt; 6) | d; bits += 6; if (bits &gt;= 0) { dst[out++] = (unsigned char)((val &gt;&gt; bits) &amp; 0xFF); bits -= 8; } } return out; } static int starts_with_ci(const char *s, const char *prefix) { while (*prefix) { if (tolower((unsigned char)*s) != tolower((unsigned char)*prefix)) return 0; s++; prefix++; } return 1; } /* Map UTF-8 0xC3 xx Latin-1 Supplement accented letters to base ASCII */ static char map_latin1_c3(unsigned char b2) { if (b2 &gt;= 0x80 &amp;&amp; b2 &lt;= 0x85) return &#039;A&#039;; if (b2 == 0x87) return &#039;C&#039;; if (b2 &gt;= 0x88 &amp;&amp; b2 &lt;= 0x8B) return &#039;E&#039;; if (b2 &gt;= 0x8C &amp;&amp; b2 &lt;= 0x8F) return &#039;I&#039;; if (b2 == 0x91) return &#039;N&#039;; if (b2 &gt;= 0x92 &amp;&amp; b2 &lt;= 0x96) return &#039;O&#039;; if (b2 &gt;= 0x99 &amp;&amp; b2 &lt;= 0x9C) return &#039;U&#039;; if (b2 == 0x9D) return &#039;Y&#039;; if (b2 &gt;= 0xA0 &amp;&amp; b2 &lt;= 0xA5) return &#039;a&#039;; if (b2 == 0xA7) return &#039;c&#039;; if (b2 &gt;= 0xA8 &amp;&amp; b2 &lt;= 0xAB) return &#039;e&#039;; if (b2 &gt;= 0xAC &amp;&amp; b2 &lt;= 0xAF) return &#039;i&#039;; if (b2 == 0xB1) return &#039;n&#039;; if (b2 &gt;= 0xB2 &amp;&amp; b2 &lt;= 0xB6) return &#039;o&#039;; if (b2 &gt;= 0xB9 &amp;&amp; b2 &lt;= 0xBC) return &#039;u&#039;; if (b2 == 0xBD || b2 == 0xBF) return &#039;y&#039;; return 0; } /* Append decoded UTF-8 bytes into clean ASCII out AND raw decoded UTF-8 out. Sets *had_stripped = 1 if any character was dropped instead of transliterated. */ static void process_utf8_chunk( const unsigned char *src, size_t slen, char *out_clean, size_t *oi_clean, size_t clean_max, char *out_utf8, size_t *oi_utf8, size_t utf8_max, int *had_stripped ) { size_t k = 0; while (k &lt; slen &amp;&amp; *oi_clean + 1 &lt; clean_max) { unsigned char b1 = src[k]; if (b1 &lt; 0x80) { if (b1 &gt;= 0x20 &amp;&amp; b1 &lt;= 0x7E) { out_clean[(*oi_clean)++] = (char)b1; if (*oi_utf8 + 1 &lt; utf8_max) out_utf8[(*oi_utf8)++] = (char)b1; } k++; } else if ((b1 &amp; 0xE0) == 0xC0 &amp;&amp; k + 1 &lt; slen) { /* Copy original 2-byte UTF-8 to decoded log buffer */ if (*oi_utf8 + 2 &lt; utf8_max) { out_utf8[(*oi_utf8)++] = (char)src[k]; out_utf8[(*oi_utf8)++] = (char)src[k + 1]; } if (b1 == 0xC3) { char mapped = map_latin1_c3(src[k + 1]); if (mapped) { out_clean[(*oi_clean)++] = mapped; } else { *had_stripped = 1; } } else if (b1 == 0xC2 &amp;&amp; src[k + 1] == 0xA0) { /* Non-breaking space -&gt; regular space */ out_clean[(*oi_clean)++] = &#039; &#039;; } else { *had_stripped = 1; } k += 2; } else if ((b1 &amp; 0xF0) == 0xE0 &amp;&amp; k + 2 &lt; slen) { /* Copy original 3-byte UTF-8 to decoded log buffer */ if (*oi_utf8 + 3 &lt; utf8_max) { out_utf8[(*oi_utf8)++] = (char)src[k]; out_utf8[(*oi_utf8)++] = (char)src[k + 1]; out_utf8[(*oi_utf8)++] = (char)src[k + 2]; } /* Common 3-byte smart punctuation (0xE2 0x80 xx) */ if (b1 == 0xE2 &amp;&amp; src[k + 1] == 0x80) { unsigned char b3 = src[k + 2]; if (b3 == 0x93 || b3 == 0x94) { out_clean[(*oi_clean)++] = &#039;-&#039;; } else if (b3 == 0x98 || b3 == 0x99) { out_clean[(*oi_clean)++] = &#039;\&#039;&#039;; } else if (b3 == 0x9C || b3 == 0x9D) { out_clean[(*oi_clean)++] = &#039;&quot;&#039;; } else if (b3 == 0xA6 &amp;&amp; *oi_clean + 3 &lt; clean_max) { out_clean[(*oi_clean)++] = &#039;.&#039;; out_clean[(*oi_clean)++] = &#039;.&#039;; out_clean[(*oi_clean)++] = &#039;.&#039;; } else { *had_stripped = 1; } } else { *had_stripped = 1; } k += 3; } else if ((b1 &amp; 0xF8) == 0xF0 &amp;&amp; k + 3 &lt; slen) { /* Copy original 4-byte UTF-8 (emojis) to decoded log buffer */ if (*oi_utf8 + 4 &lt; utf8_max) { out_utf8[(*oi_utf8)++] = (char)src[k]; out_utf8[(*oi_utf8)++] = (char)src[k + 1]; out_utf8[(*oi_utf8)++] = (char)src[k + 2]; out_utf8[(*oi_utf8)++] = (char)src[k + 3]; } *had_stripped = 1; k += 4; } else { /* Stray/invalid byte -&gt; skip */ k++; } } } static int clean_subject_value( const char *in, char *out_clean, size_t clean_max, char *out_utf8, size_t utf8_max ) { size_t oi_clean = 0; size_t oi_utf8 = 0; const char *p = in; int prev_was_encoded = 0; int had_stripped = 0; while (*p &amp;&amp; oi_clean + 1 &lt; clean_max) { if (p[0] == &#039;=&#039; &amp;&amp; p[1] == &#039;?&#039;) { const char *q1 = strchr(p + 2, &#039;?&#039;); if (q1 &amp;&amp; (q1[1] == &#039;Q&#039; || q1[1] == &#039;q&#039; || q1[1] == &#039;B&#039; || q1[1] == &#039;b&#039;) &amp;&amp; q1[2] == &#039;?&#039;) { char enc = (char)toupper((unsigned char)q1[1]); const char *payload = q1 + 3; const char *end = strstr(payload, &quot;?=&quot;); if (end) { /* Strip inter-word whitespace between adjacent encoded words */ if (prev_was_encoded) { while (oi_clean &gt; 0 &amp;&amp; (out_clean[oi_clean - 1] == &#039; &#039; || out_clean[oi_clean - 1] == &#039;\t&#039;)) { oi_clean--; } while (oi_utf8 &gt; 0 &amp;&amp; (out_utf8[oi_utf8 - 1] == &#039; &#039; || out_utf8[oi_utf8 - 1] == &#039;\t&#039;)) { oi_utf8--; } } size_t plen = (size_t)(end - payload); unsigned char *tmp = (unsigned char *)malloc(plen + 4); if (tmp) { size_t dlen = (enc == &#039;Q&#039;) ? decode_qp(payload, plen, tmp) : decode_b64(payload, plen, tmp); process_utf8_chunk( tmp, dlen, out_clean, &amp;oi_clean, clean_max, out_utf8, &amp;oi_utf8, utf8_max, &amp;had_stripped ); free(tmp); } p = end + 2; prev_was_encoded = 1; continue; } } } unsigned char ch = (unsigned char)*p; if (ch != &#039; &#039; &amp;&amp; ch != &#039;\t&#039;) { prev_was_encoded = 0; } if (ch &lt; 0x80) { if (ch &gt;= 0x20 &amp;&amp; ch &lt;= 0x7E) { out_clean[oi_clean++] = (char)ch; if (oi_utf8 + 1 &lt; utf8_max) out_utf8[oi_utf8++] = (char)ch; } p++; } else { /* Handle unencoded 8-bit UTF-8 sequences directly in the Subject header */ size_t avail = strlen(p); size_t seq_len = 1; if ((ch &amp; 0xE0) == 0xC0 &amp;&amp; avail &gt;= 2) seq_len = 2; else if ((ch &amp; 0xF0) == 0xE0 &amp;&amp; avail &gt;= 3) seq_len = 3; else if ((ch &amp; 0xF8) == 0xF0 &amp;&amp; avail &gt;= 4) seq_len = 4; process_utf8_chunk( (const unsigned char *)p, seq_len, out_clean, &amp;oi_clean, clean_max, out_utf8, &amp;oi_utf8, utf8_max, &amp;had_stripped ); p += seq_len; } } while (oi_clean &gt; 0 &amp;&amp; (out_clean[oi_clean - 1] == &#039; &#039; || out_clean[oi_clean - 1] == &#039;\t&#039;)) { oi_clean--; } out_clean[oi_clean] = &#039;\0&#039;; while (oi_utf8 &gt; 0 &amp;&amp; (out_utf8[oi_utf8 - 1] == &#039; &#039; || out_utf8[oi_utf8 - 1] == &#039;\t&#039;)) { oi_utf8--; } out_utf8[oi_utf8] = &#039;\0&#039;; return had_stripped; } static void log_stripped_subject(const char *msg_path, const char *custom_log, const char *utf8_subj, const char *clean_subj) { char log_path[1024]; if (custom_log &amp;&amp; custom_log[0] != &#039;\0&#039;) { snprintf(log_path, sizeof(log_path), &quot;%s&quot;, custom_log); } else { /* Place stripped_utf8.log in the same directory as the .CNM file */ snprintf(log_path, sizeof(log_path), &quot;%s&quot;, msg_path); char *slash1 = strrchr(log_path, &#039;/&#039;); char *slash2 = strrchr(log_path, &#039;\\&#039;); char *last_slash = (slash1 &gt; slash2) ? slash1 : slash2; if (last_slash) { *(last_slash + 1) = &#039;\0&#039;; strncat(log_path, &quot;stripped_utf8.log&quot;, sizeof(log_path) - strlen(log_path) - 1); } else { snprintf(log_path, sizeof(log_path), &quot;stripped_utf8.log&quot;); } } FILE *flog = fopen(log_path, &quot;ab&quot;); if (!flog) return; time_t now = time(NULL); struct tm *tm_info = localtime(&amp;now); char ts[32] = &quot;0000-00-00 00:00:00&quot;; if (tm_info) { strftime(ts, sizeof(ts), &quot;%Y-%m-%d %H:%M:%S&quot;, tm_info); } /* Extract just the filename for cleaner log entries */ const char *fname = msg_path; const char *s1 = strrchr(msg_path, &#039;/&#039;); const char *s2 = strrchr(msg_path, &#039;\\&#039;); if (s1 || s2) { fname = ((s1 &gt; s2) ? s1 : s2) + 1; } fprintf(flog, &quot;[%s] %s\n UTF-8 : %s\n Clean : %s\n\n&quot;, ts, fname, utf8_subj, clean_subj); fclose(flog); } int main(int argc, char *argv[]) { if (argc &lt; 2) { fprintf(stderr, &quot;Usage: %s &lt;message.cnm&gt; [logfile]\n&quot;, argv[0]); return 1; } const char *path = argv[1]; const char *custom_log = (argc &gt;= 3) ? argv[2] : NULL; FILE *fin = fopen(path, &quot;rb&quot;); if (!fin) return 1; char tmp_path[1024]; snprintf(tmp_path, sizeof(tmp_path), &quot;%s.tmp&quot;, path); FILE *fout = fopen(tmp_path, &quot;wb&quot;); if (!fout) { fclose(fin); return 1; } char line[8192]; char subj_raw[MAX_HDR_BUF]; char subj_clean[MAX_HDR_BUF]; char subj_utf8[MAX_HDR_BUF]; int in_subject = 0; int headers_done = 0; int detected_crlf = 1; while (fgets(line, sizeof(line), fin)) { if (!headers_done) { size_t len = strlen(line); int has_crlf = (len &gt;= 2 &amp;&amp; line[len - 2] == &#039;\r&#039; &amp;&amp; line[len - 1] == &#039;\n&#039;); if (len &gt;= 1) detected_crlf = has_crlf; while (len &gt; 0 &amp;&amp; (line[len - 1] == &#039;\r&#039; || line[len - 1] == &#039;\n&#039;)) { line[--len] = &#039;\0&#039;; } if (in_subject) { if (len &gt; 0 &amp;&amp; (line[0] == &#039; &#039; || line[0] == &#039;\t&#039;)) { const char *cont = line; while (*cont == &#039; &#039; || *cont == &#039;\t&#039;) cont++; size_t cur = strlen(subj_raw); if (cur + strlen(cont) + 2 &lt; sizeof(subj_raw)) { if (cur &gt; 0) strcat(subj_raw, &quot; &quot;); strcat(subj_raw, cont); } continue; } else { int had_stripped = clean_subject_value( subj_raw, subj_clean, sizeof(subj_clean), subj_utf8, sizeof(subj_utf8) ); if (had_stripped) { log_stripped_subject(path, custom_log, subj_utf8, subj_clean); } fprintf(fout, &quot;Subject: %s%s&quot;, subj_clean, detected_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); in_subject = 0; } } if (len == 0) { headers_done = 1; fprintf(fout, &quot;%s&quot;, detected_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); continue; } if (starts_with_ci(line, &quot;Subject:&quot;)) { const char *val = line + 8; while (*val == &#039; &#039; || *val == &#039;\t&#039;) val++; snprintf(subj_raw, sizeof(subj_raw), &quot;%s&quot;, val); in_subject = 1; continue; } fprintf(fout, &quot;%s%s&quot;, line, has_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); } else { fwrite(line, 1, strlen(line), fout); } } if (in_subject) { int had_stripped = clean_subject_value( subj_raw, subj_clean, sizeof(subj_clean), subj_utf8, sizeof(subj_utf8) ); if (had_stripped) { log_stripped_subject(path, custom_log, subj_utf8, subj_clean); } fprintf(fout, &quot;Subject: %s%s&quot;, subj_clean, detected_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); } fclose(fin); fclose(fout); remove(path); if (rename(tmp_path, path) != 0) { return 1; } return 0; } ````

mikes@guam.net

Better version of stripchar3.cpp (Can work directly without shell or bat file)


18431 Nov 28 10:00 stripchar3.cpp
25600 Nov 28 10:28 stripchar3.exe
13216 Nov 28 10:29 stripchar3
25600 Nov 28 10:29 stripchar3s.exe


Better version of stripchar3.cpp (Can work directly without shell or bat file) 18431 Nov 28 10:00 stripchar3.cpp 25600 Nov 28 10:28 stripchar3.exe 13216 Nov 28 10:29 stripchar3 25600 Nov 28 10:29 stripchar3s.exe

mikes@guam.net

18431 Nov 28 10:00 stripchar3.cpp (source code)
25600 Nov 28 10:28 stripchar3.exe (ming compiled stripped and upx compressed)
13216 Nov 28 10:29 stripchar3 (g++ compiled stripped and upx compressed)


Note: regular compile with ming makes a 290K file, stripping it goes down to about 50K, and then using UPX takes it down to about 25K. Same source for programs. Not sure if source would compile with native windows compileter.


Coud make exe file available if anyone interested.


Both need to be run with path to Mail Directory.
linux for my setup ./stripchar3 /home/msetzerii/.wine/drive_c/PMAIL/MAIL/


multiuser would be
./stripchar3 /home/user/.wine/drive_c/PMAIL/MAIL/peguser/


running using wine to exe would be
wine stripchar3.exe "C:\PMAIL\MAIL\" or "C:\PMAIL\MAIL\user''' or C:/PMAIL/MAIL/ or combinations??


Under windows native it would just be stripchar3 C:\PMAIL\MAIL
It has built in to chhange to mail directory passed, and then check all CNM files, and modify any with UTF in subject.


Might need to refresh new mail folder. Would download new mail, then run. Does create a log file for records with more than accent characters. So, one could reviewer what was removed from Subject line.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>

#ifdef _WIN32
#include <windows.h>
#else
#include <dirent.h>
#include <sys/stat.h>
#endif

#define MAX_HDR_BUF 65536
#define MAX_PATH_BUF 4096

static int hex_val(char c) {
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'A' && c <= 'F') return c - 'A' + 10;
if (c >= 'a' && c <= 'f') return c - 'a' + 10;
return -1;
}

static int b64_val(char c) {
if (c >= 'A' && c <= 'Z') return c - 'A';
if (c >= 'a' && c <= 'z') return c - 'a' + 26;
if (c >= '0' && c <= '9') return c - '0' + 52;
if (c == '+') return 62;
if (c == '/') return 63;
return -1;
}

static size_t decode_qp(const char *src, size_t len, unsigned char *dst) {
size_t out = 0;
for (size_t i = 0; i < len; i++) {
if (src[i] == '_') {
dst[out++] = ' ';
} else if (src[i] == '=' && i + 2 < len) {
int h1 = hex_val(src[i + 1]);
int h2 = hex_val(src[i + 2]);
if (h1 >= 0 && h2 >= 0) {
dst[out++] = (unsigned char)((h1 << 4) | h2);
i += 2;
} else {
dst[out++] = (unsigned char)src[i];
}
} else {
dst[out++] = (unsigned char)src[i];
}
}
return out;
}

static size_t decode_b64(const char *src, size_t len, unsigned char *dst) {
size_t out = 0;
int val = 0, bits = -8;
for (size_t i = 0; i < len; i++) {
if (src[i] == '=') break;
int d = b64_val(src[i]);
if (d < 0) continue;
val = (val << 6) | d;
bits += 6;
if (bits >= 0) {
dst[out++] = (unsigned char)((val >> bits) & 0xFF);
bits -= 8;
}
}
return out;
}

static int starts_with_ci(const char *s, const char *prefix) {
while (*prefix) {
if (tolower((unsigned char)*s) != tolower((unsigned char)*prefix)) return 0;
s++;
prefix++;
}
return 1;
}

static int ends_with_cnm_ci(const char *name) {
size_t len = strlen(name);
if (len < 4) return 0;
const char *ext = name + len - 4;
return (ext[0] == '.' &&
tolower((unsigned char)ext[1]) == 'c' &&
tolower((unsigned char)ext[2]) == 'n' &&
tolower((unsigned char)ext[3]) == 'm');
}

/* Map UTF-8 0xC3 xx Latin-1 Supplement accented letters to base ASCII */
static char map_latin1_c3(unsigned char b2) {
if (b2 >= 0x80 && b2 <= 0x85) return 'A';
if (b2 == 0x87) return 'C';
if (b2 >= 0x88 && b2 <= 0x8B) return 'E';
if (b2 >= 0x8C && b2 <= 0x8F) return 'I';
if (b2 == 0x91) return 'N';
if (b2 >= 0x92 && b2 <= 0x96) return 'O';
if (b2 >= 0x99 && b2 <= 0x9C) return 'U';
if (b2 == 0x9D) return 'Y';

if (b2 >= 0xA0 && b2 <= 0xA5) return 'a';
if (b2 == 0xA7) return 'c';
if (b2 >= 0xA8 && b2 <= 0xAB) return 'e';
if (b2 >= 0xAC && b2 <= 0xAF) return 'i';
if (b2 == 0xB1) return 'n';
if (b2 >= 0xB2 && b2 <= 0xB6) return 'o';
if (b2 >= 0xB9 && b2 <= 0xBC) return 'u';
if (b2 == 0xBD || b2 == 0xBF) return 'y';

return 0;
}

/* Append decoded UTF-8 bytes into clean ASCII out AND raw decoded UTF-8 out.
Sets *had_stripped = 1 if any character was dropped instead of transliterated. */

static void process_utf8_chunk(
const unsigned char *src, size_t slen,
char *out_clean, size_t *oi_clean, size_t clean_max,
char *out_utf8, size_t *oi_utf8, size_t utf8_max,
int *had_stripped
) {
size_t k = 0;
while (k < slen && *oi_clean + 1 < clean_max) {
unsigned char b1 = src[k];
if (b1 < 0x80) {
if (b1 >= 0x20 && b1 <= 0x7E) {
out_clean[(*oi_clean)++] = (char)b1;
if (*oi_utf8 + 1 < utf8_max) out_utf8[(*oi_utf8)++] = (char)b1;
}
k++;
} else if ((b1 & 0xE0) == 0xC0 && k + 1 < slen) {
/* Copy original 2-byte UTF-8 to decoded log buffer */
if (*oi_utf8 + 2 < utf8_max) {
out_utf8[(*oi_utf8)++] = (char)src[k];
out_utf8[(*oi_utf8)++] = (char)src[k + 1];
}

if (b1 == 0xC3) {
char mapped = map_latin1_c3(src[k + 1]);
if (mapped) {
out_clean[(*oi_clean)++] = mapped;
} else {
*had_stripped = 1;
}
} else if (b1 == 0xC2 && src[k + 1] == 0xA0) {
/* Non-breaking space -> regular space */
out_clean[(*oi_clean)++] = ' ';
} else {
*had_stripped = 1;
}
k += 2;
} else if ((b1 & 0xF0) == 0xE0 && k + 2 < slen) {
/* Copy original 3-byte UTF-8 to decoded log buffer */
if (*oi_utf8 + 3 < utf8_max) {
out_utf8[(*oi_utf8)++] = (char)src[k];
out_utf8[(*oi_utf8)++] = (char)src[k + 1];
out_utf8[(*oi_utf8)++] = (char)src[k + 2];
}

/* Common 3-byte smart punctuation (0xE2 0x80 xx) */
if (b1 == 0xE2 && src[k + 1] == 0x80) {
unsigned char b3 = src[k + 2];
if (b3 == 0x93 || b3 == 0x94) {
out_clean[(*oi_clean)++] = '-';
} else if (b3 == 0x98 || b3 == 0x99) {
out_clean[(*oi_clean)++] = '\'';
} else if (b3 == 0x9C || b3 == 0x9D) {
out_clean[(*oi_clean)++] = '"';
} else if (b3 == 0xA6 && *oi_clean + 3 < clean_max) {
out_clean[(*oi_clean)++] = '.';
out_clean[(*oi_clean)++] = '.';
out_clean[(*oi_clean)++] = '.';
} else {
*had_stripped = 1;
}
} else {
*had_stripped = 1;
}
k += 3;
} else if ((b1 & 0xF8) == 0xF0 && k + 3 < slen) {
/* Copy original 4-byte UTF-8 (emojis) to decoded log buffer */
if (*oi_utf8 + 4 < utf8_max) {
out_utf8[(*oi_utf8)++] = (char)src[k];
out_utf8[(*oi_utf8)++] = (char)src[k + 1];
out_utf8[(*oi_utf8)++] = (char)src[k + 2];
out_utf8[(*oi_utf8)++] = (char)src[k + 3];
}
*had_stripped = 1;
k += 4;
} else {
/* Stray/invalid byte -> skip */
k++;
}
}
}

static int clean_subject_value(
const char *in,
char *out_clean, size_t clean_max,
char *out_utf8, size_t utf8_max
) {
size_t oi_clean = 0;
size_t oi_utf8 = 0;
const char *p = in;
int prev_was_encoded = 0;
int had_stripped = 0;

while (*p && oi_clean + 1 < clean_max) {
if (p[0] == '=' && p[1] == '?') {
const char *q1 = strchr(p + 2, '?');
if (q1 && (q1[1] == 'Q' || q1[1] == 'q' || q1[1] == 'B' || q1[1] == 'b') && q1[2] == '?') {
char enc = (char)toupper((unsigned char)q1[1]);
const char *payload = q1 + 3;
const char *end = strstr(payload, "?=");
if (end) {
/* Strip inter-word whitespace between adjacent encoded words */
if (prev_was_encoded) {
while (oi_clean > 0 && (out_clean[oi_clean - 1] == ' ' || out_clean[oi_clean - 1] == '\t')) {
oi_clean--;
}
while (oi_utf8 > 0 && (out_utf8[oi_utf8 - 1] == ' ' || out_utf8[oi_utf8 - 1] == '\t')) {
oi_utf8--;
}
}

size_t plen = (size_t)(end - payload);
unsigned char *tmp = (unsigned char *)malloc(plen + 4);
if (tmp) {
size_t dlen = (enc == 'Q')
? decode_qp(payload, plen, tmp)
: decode_b64(payload, plen, tmp);

process_utf8_chunk(
tmp, dlen,
out_clean, &oi_clean, clean_max,
out_utf8, &oi_utf8, utf8_max,
&had_stripped
);
free(tmp);
}
p = end + 2;
prev_was_encoded = 1;
continue;
}
}
}

unsigned char ch = (unsigned char)*p;
if (ch != ' ' && ch != '\t') {
prev_was_encoded = 0;
}

if (ch < 0x80) {
if (ch >= 0x20 && ch <= 0x7E) {
out_clean[oi_clean++] = (char)ch;
if (oi_utf8 + 1 < utf8_max) out_utf8[oi_utf8++] = (char)ch;
}
p++;
} else {
/* Handle unencoded 8-bit UTF-8 sequences directly in the Subject header */
size_t avail = strlen(p);
size_t seq_len = 1;
if ((ch & 0xE0) == 0xC0 && avail >= 2) seq_len = 2;
else if ((ch & 0xF0) == 0xE0 && avail >= 3) seq_len = 3;
else if ((ch & 0xF8) == 0xF0 && avail >= 4) seq_len = 4;

process_utf8_chunk(
(const unsigned char *)p, seq_len,
out_clean, &oi_clean, clean_max,
out_utf8, &oi_utf8, utf8_max,
&had_stripped
);
p += seq_len;
}
}

while (oi_clean > 0 && (out_clean[oi_clean - 1] == ' ' || out_clean[oi_clean - 1] == '\t')) {
oi_clean--;
}
out_clean[oi_clean] = '\0';

while (oi_utf8 > 0 && (out_utf8[oi_utf8 - 1] == ' ' || out_utf8[oi_utf8 - 1] == '\t')) {
oi_utf8--;
}
out_utf8[oi_utf8] = '\0';

return had_stripped;
}

static void log_stripped_subject(const char *msg_path, const char *custom_log, const char *utf8_subj, const char *clean_subj) {
char log_path[MAX_PATH_BUF];
if (custom_log && custom_log[0] != '\0') {
snprintf(log_path, sizeof(log_path), "%s", custom_log);
} else {
/* Place stripped_utf8.log in the same directory as the .CNM file */
snprintf(log_path, sizeof(log_path), "%s", msg_path);
char *slash1 = strrchr(log_path, '/');
char *slash2 = strrchr(log_path, '\\');
char *last_slash = (slash1 > slash2) ? slash1 : slash2;
if (last_slash) {
*(last_slash + 1) = '\0';
strncat(log_path, "stripped_utf8.log", sizeof(log_path) - strlen(log_path) - 1);
} else {
snprintf(log_path, sizeof(log_path), "stripped_utf8.log");
}
}

FILE *flog = fopen(log_path, "ab");
if (!flog) return;

time_t now = time(NULL);
struct tm *tm_info = localtime(&now);
char ts[32] = "0000-00-00 00:00:00";
if (tm_info) {
strftime(ts, sizeof(ts), "%Y-%m-%d %H:%M:%S", tm_info);
}

/* Extract just the filename for cleaner log entries */
const char *fname = msg_path;
const char *s1 = strrchr(msg_path, '/');
const char *s2 = strrchr(msg_path, '\\');
if (s1 || s2) {
fname = ((s1 > s2) ? s1 : s2) + 1;
}

fprintf(flog, "[%s] %s\n UTF-8 : %s\n Clean : %s\n\n", ts, fname, utf8_subj, clean_subj);
fclose(flog);
}

/* Quick scan of headers to skip files that do not need updating */
static int file_needs_cleaning(const char *path) {
FILE *f = fopen(path, "rb");
if (!f) return 0;

char line[8192];
int in_subject = 0;
int needs_work = 0;

while (fgets(line, sizeof(line), f)) {
size_t len = strlen(line);
while (len > 0 && (line[len - 1] == '\r' || line[len - 1] == '\n')) {
line[--len] = '\0';
}
if (len == 0) break;

if (in_subject) {
if (line[0] != ' ' && line[0] != '\t') {
break;
}
} else if (starts_with_ci(line, "Subject:")) {
in_subject = 1;
}

if (in_subject) {
if (strstr(line, "=?") != NULL) {
needs_work = 1;
break;
}
for (size_t i = 0; i < len; i++) {
if ((unsigned char)line[i] >= 0x80) {
needs_work = 1;
break;
}
}
if (needs_work) break;
}
}

fclose(f);
return needs_work;
}

static int process_cnm_file(const char *path, const char *custom_log) {
if (!file_needs_cleaning(path)) {
return 0;
}

FILE *fin = fopen(path, "rb");
if (!fin) return -1;

char tmp_path[MAX_PATH_BUF];
snprintf(tmp_path, sizeof(tmp_path), "%s.tmp", path);
FILE *fout = fopen(tmp_path, "wb");
if (!fout) {
fclose(fin);
return -1;
}

char line[8192];
char subj_raw[MAX_HDR_BUF];
char subj_clean[MAX_HDR_BUF];
char subj_utf8[MAX_HDR_BUF];
int in_subject = 0;
int headers_done = 0;
int detected_crlf = 1;

while (fgets(line, sizeof(line), fin)) {
if (!headers_done) {
size_t len = strlen(line);
int has_crlf = (len >= 2 && line[len - 2] == '\r' && line[len - 1] == '\n');
if (len >= 1) detected_crlf = has_crlf;

while (len > 0 && (line[len - 1] == '\r' || line[len - 1] == '\n')) {
line[--len] = '\0';
}

if (in_subject) {
if (len > 0 && (line[0] == ' ' || line[0] == '\t')) {
const char *cont = line;
while (*cont == ' ' || *cont == '\t') cont++;
size_t cur = strlen(subj_raw);
if (cur + strlen(cont) + 2 < sizeof(subj_raw)) {
if (cur > 0) strcat(subj_raw, " ");
strcat(subj_raw, cont);
}
continue;
} else {
int had_stripped = clean_subject_value(
subj_raw,
subj_clean, sizeof(subj_clean),
subj_utf8, sizeof(subj_utf8)
);
if (had_stripped) {
log_stripped_subject(path, custom_log, subj_utf8, subj_clean);
}
fprintf(fout, "Subject: %s%s", subj_clean, detected_crlf ? "\r\n" : "\n");
in_subject = 0;
}
}

if (len == 0) {
headers_done = 1;
fprintf(fout, "%s", detected_crlf ? "\r\n" : "\n");
continue;
}

if (starts_with_ci(line, "Subject:")) {
const char *val = line + 8;
while (*val == ' ' || *val == '\t') val++;
snprintf(subj_raw, sizeof(subj_raw), "%s", val);
in_subject = 1;
continue;
}

fprintf(fout, "%s%s", line, has_crlf ? "\r\n" : "\n");
} else {
fwrite(line, 1, strlen(line), fout);
}
}

if (in_subject) {
int had_stripped = clean_subject_value(
subj_raw,
subj_clean, sizeof(subj_clean),
subj_utf8, sizeof(subj_utf8)
);
if (had_stripped) {
log_stripped_subject(path, custom_log, subj_utf8, subj_clean);
}
fprintf(fout, "Subject: %s%s", subj_clean, detected_crlf ? "\r\n" : "\n");
}

fclose(fin);
fclose(fout);

remove(path);
if (rename(tmp_path, path) != 0) {
return -1;
}

return 1;
}

int main(int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: %s <mail_dir_or_file.cnm> [logfile]\n", argv[0]);
return 1;
}

char target[MAX_PATH_BUF];
snprintf(target, sizeof(target), "%s", argv[1]);
size_t tlen = strlen(target);
while (tlen > 1 && (target[tlen - 1] == '/' || target[tlen - 1] == '\\')) {
target[--tlen] = '\0';
}

const char *custom_log = (argc >= 3) ? argv[2] : NULL;

#ifdef _WIN32
DWORD attr = GetFileAttributesA(target);
if (attr == INVALID_FILE_ATTRIBUTES) {
fprintf(stderr, "Error: Path not found: %s\n", target);
return 1;
}
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
char search_pattern[MAX_PATH_BUF];
snprintf(search_pattern, sizeof(search_pattern), "%s\\*", target);
WIN32_FIND_DATAA ffd;
HANDLE hFind = FindFirstFileA(search_pattern, &ffd);
if (hFind == INVALID_HANDLE_VALUE) return 1;

int cleaned_count = 0;
do {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
if (ends_with_cnm_ci(ffd.cFileName)) {
char full_path[MAX_PATH_BUF];
snprintf(full_path, sizeof(full_path), "%s\\%s", target, ffd.cFileName);
if (process_cnm_file(full_path, custom_log) == 1) {
cleaned_count++;
}
}
} while (FindNextFileA(hFind, &ffd) != 0);
FindClose(hFind);
printf("Processed directory: %d file(s) updated.\n", cleaned_count);
} else {
process_cnm_file(target, custom_log);
}
#else
struct stat st;
if (stat(target, &st) != 0) {
fprintf(stderr, "Error: Path not found: %s\n", target);
return 1;
}
if (S_ISDIR(st.st_mode)) {
DIR *dir = opendir(target);
if (!dir) {
fprintf(stderr, "Error: Cannot open directory: %s\n", target);
return 1;
}
struct dirent *ent;
int cleaned_count = 0;
while ((ent = readdir(dir)) != NULL) {
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue;
if (ends_with_cnm_ci(ent->d_name)) {
char full_path[MAX_PATH_BUF];
snprintf(full_path, sizeof(full_path), "%s/%s", target, ent->d_name);
struct stat fst;
if (stat(full_path, &fst) == 0 && S_ISREG(fst.st_mode)) {
if (process_cnm_file(full_path, custom_log) == 1) {
cleaned_count++;
}
}
}
}
closedir(dir);
printf("Processed directory: %d file(s) updated.\n", cleaned_count);
} else if (S_ISREG(st.st_mode)) {
process_cnm_file(target, custom_log);
}
#endif

return 0;
}

Did try to add as externsion ot toolbar button, but nothing we (google ai) worked.


Interesting. Didn't really look at code much, had done similar in past with other things.


18431 Nov 28 10:00 stripchar3.cpp (source code) 25600 Nov 28 10:28 stripchar3.exe (ming compiled stripped and upx compressed) 13216 Nov 28 10:29 stripchar3 (g++ compiled stripped and upx compressed) Note: regular compile with ming makes a 290K file, stripping it goes down to about 50K, and then using UPX takes it down to about 25K. Same source for programs. Not sure if source would compile with native windows compileter. Coud make exe file available if anyone interested. Both need to be run with path to Mail Directory. linux for my setup ./stripchar3 /home/msetzerii/.wine/drive_c/PMAIL/MAIL/ multiuser would be ./stripchar3 /home/user/.wine/drive_c/PMAIL/MAIL/peguser/ running using wine to exe would be wine stripchar3.exe &quot;C:\\PMAIL\\MAIL\\&quot; or &quot;C:\\PMAIL\\MAIL\\user&#039;&#039;&#039; or C:/PMAIL/MAIL/ or combinations?? Under windows native it would just be stripchar3 C:\PMAIL\MAIL It has built in to chhange to mail directory passed, and then check all CNM files, and modify any with UTF in subject. Might need to refresh new mail folder. Would download new mail, then run. Does create a log file for records with more than accent characters. So, one could reviewer what was removed from Subject line. ```` #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;ctype.h&gt; #include &lt;time.h&gt; #ifdef _WIN32 #include &lt;windows.h&gt; #else #include &lt;dirent.h&gt; #include &lt;sys/stat.h&gt; #endif #define MAX_HDR_BUF 65536 #define MAX_PATH_BUF 4096 static int hex_val(char c) { if (c &gt;= &#039;0&#039; &amp;&amp; c &lt;= &#039;9&#039;) return c - &#039;0&#039;; if (c &gt;= &#039;A&#039; &amp;&amp; c &lt;= &#039;F&#039;) return c - &#039;A&#039; + 10; if (c &gt;= &#039;a&#039; &amp;&amp; c &lt;= &#039;f&#039;) return c - &#039;a&#039; + 10; return -1; } static int b64_val(char c) { if (c &gt;= &#039;A&#039; &amp;&amp; c &lt;= &#039;Z&#039;) return c - &#039;A&#039;; if (c &gt;= &#039;a&#039; &amp;&amp; c &lt;= &#039;z&#039;) return c - &#039;a&#039; + 26; if (c &gt;= &#039;0&#039; &amp;&amp; c &lt;= &#039;9&#039;) return c - &#039;0&#039; + 52; if (c == &#039;+&#039;) return 62; if (c == &#039;/&#039;) return 63; return -1; } static size_t decode_qp(const char *src, size_t len, unsigned char *dst) { size_t out = 0; for (size_t i = 0; i &lt; len; i++) { if (src[i] == &#039;_&#039;) { dst[out++] = &#039; &#039;; } else if (src[i] == &#039;=&#039; &amp;&amp; i + 2 &lt; len) { int h1 = hex_val(src[i + 1]); int h2 = hex_val(src[i + 2]); if (h1 &gt;= 0 &amp;&amp; h2 &gt;= 0) { dst[out++] = (unsigned char)((h1 &lt;&lt; 4) | h2); i += 2; } else { dst[out++] = (unsigned char)src[i]; } } else { dst[out++] = (unsigned char)src[i]; } } return out; } static size_t decode_b64(const char *src, size_t len, unsigned char *dst) { size_t out = 0; int val = 0, bits = -8; for (size_t i = 0; i &lt; len; i++) { if (src[i] == &#039;=&#039;) break; int d = b64_val(src[i]); if (d &lt; 0) continue; val = (val &lt;&lt; 6) | d; bits += 6; if (bits &gt;= 0) { dst[out++] = (unsigned char)((val &gt;&gt; bits) &amp; 0xFF); bits -= 8; } } return out; } static int starts_with_ci(const char *s, const char *prefix) { while (*prefix) { if (tolower((unsigned char)*s) != tolower((unsigned char)*prefix)) return 0; s++; prefix++; } return 1; } static int ends_with_cnm_ci(const char *name) { size_t len = strlen(name); if (len &lt; 4) return 0; const char *ext = name + len - 4; return (ext[0] == &#039;.&#039; &amp;&amp; tolower((unsigned char)ext[1]) == &#039;c&#039; &amp;&amp; tolower((unsigned char)ext[2]) == &#039;n&#039; &amp;&amp; tolower((unsigned char)ext[3]) == &#039;m&#039;); } /* Map UTF-8 0xC3 xx Latin-1 Supplement accented letters to base ASCII */ static char map_latin1_c3(unsigned char b2) { if (b2 &gt;= 0x80 &amp;&amp; b2 &lt;= 0x85) return &#039;A&#039;; if (b2 == 0x87) return &#039;C&#039;; if (b2 &gt;= 0x88 &amp;&amp; b2 &lt;= 0x8B) return &#039;E&#039;; if (b2 &gt;= 0x8C &amp;&amp; b2 &lt;= 0x8F) return &#039;I&#039;; if (b2 == 0x91) return &#039;N&#039;; if (b2 &gt;= 0x92 &amp;&amp; b2 &lt;= 0x96) return &#039;O&#039;; if (b2 &gt;= 0x99 &amp;&amp; b2 &lt;= 0x9C) return &#039;U&#039;; if (b2 == 0x9D) return &#039;Y&#039;; if (b2 &gt;= 0xA0 &amp;&amp; b2 &lt;= 0xA5) return &#039;a&#039;; if (b2 == 0xA7) return &#039;c&#039;; if (b2 &gt;= 0xA8 &amp;&amp; b2 &lt;= 0xAB) return &#039;e&#039;; if (b2 &gt;= 0xAC &amp;&amp; b2 &lt;= 0xAF) return &#039;i&#039;; if (b2 == 0xB1) return &#039;n&#039;; if (b2 &gt;= 0xB2 &amp;&amp; b2 &lt;= 0xB6) return &#039;o&#039;; if (b2 &gt;= 0xB9 &amp;&amp; b2 &lt;= 0xBC) return &#039;u&#039;; if (b2 == 0xBD || b2 == 0xBF) return &#039;y&#039;; return 0; } /* Append decoded UTF-8 bytes into clean ASCII out AND raw decoded UTF-8 out. Sets *had_stripped = 1 if any character was dropped instead of transliterated. */ static void process_utf8_chunk( const unsigned char *src, size_t slen, char *out_clean, size_t *oi_clean, size_t clean_max, char *out_utf8, size_t *oi_utf8, size_t utf8_max, int *had_stripped ) { size_t k = 0; while (k &lt; slen &amp;&amp; *oi_clean + 1 &lt; clean_max) { unsigned char b1 = src[k]; if (b1 &lt; 0x80) { if (b1 &gt;= 0x20 &amp;&amp; b1 &lt;= 0x7E) { out_clean[(*oi_clean)++] = (char)b1; if (*oi_utf8 + 1 &lt; utf8_max) out_utf8[(*oi_utf8)++] = (char)b1; } k++; } else if ((b1 &amp; 0xE0) == 0xC0 &amp;&amp; k + 1 &lt; slen) { /* Copy original 2-byte UTF-8 to decoded log buffer */ if (*oi_utf8 + 2 &lt; utf8_max) { out_utf8[(*oi_utf8)++] = (char)src[k]; out_utf8[(*oi_utf8)++] = (char)src[k + 1]; } if (b1 == 0xC3) { char mapped = map_latin1_c3(src[k + 1]); if (mapped) { out_clean[(*oi_clean)++] = mapped; } else { *had_stripped = 1; } } else if (b1 == 0xC2 &amp;&amp; src[k + 1] == 0xA0) { /* Non-breaking space -&gt; regular space */ out_clean[(*oi_clean)++] = &#039; &#039;; } else { *had_stripped = 1; } k += 2; } else if ((b1 &amp; 0xF0) == 0xE0 &amp;&amp; k + 2 &lt; slen) { /* Copy original 3-byte UTF-8 to decoded log buffer */ if (*oi_utf8 + 3 &lt; utf8_max) { out_utf8[(*oi_utf8)++] = (char)src[k]; out_utf8[(*oi_utf8)++] = (char)src[k + 1]; out_utf8[(*oi_utf8)++] = (char)src[k + 2]; } /* Common 3-byte smart punctuation (0xE2 0x80 xx) */ if (b1 == 0xE2 &amp;&amp; src[k + 1] == 0x80) { unsigned char b3 = src[k + 2]; if (b3 == 0x93 || b3 == 0x94) { out_clean[(*oi_clean)++] = &#039;-&#039;; } else if (b3 == 0x98 || b3 == 0x99) { out_clean[(*oi_clean)++] = &#039;\&#039;&#039;; } else if (b3 == 0x9C || b3 == 0x9D) { out_clean[(*oi_clean)++] = &#039;&quot;&#039;; } else if (b3 == 0xA6 &amp;&amp; *oi_clean + 3 &lt; clean_max) { out_clean[(*oi_clean)++] = &#039;.&#039;; out_clean[(*oi_clean)++] = &#039;.&#039;; out_clean[(*oi_clean)++] = &#039;.&#039;; } else { *had_stripped = 1; } } else { *had_stripped = 1; } k += 3; } else if ((b1 &amp; 0xF8) == 0xF0 &amp;&amp; k + 3 &lt; slen) { /* Copy original 4-byte UTF-8 (emojis) to decoded log buffer */ if (*oi_utf8 + 4 &lt; utf8_max) { out_utf8[(*oi_utf8)++] = (char)src[k]; out_utf8[(*oi_utf8)++] = (char)src[k + 1]; out_utf8[(*oi_utf8)++] = (char)src[k + 2]; out_utf8[(*oi_utf8)++] = (char)src[k + 3]; } *had_stripped = 1; k += 4; } else { /* Stray/invalid byte -&gt; skip */ k++; } } } static int clean_subject_value( const char *in, char *out_clean, size_t clean_max, char *out_utf8, size_t utf8_max ) { size_t oi_clean = 0; size_t oi_utf8 = 0; const char *p = in; int prev_was_encoded = 0; int had_stripped = 0; while (*p &amp;&amp; oi_clean + 1 &lt; clean_max) { if (p[0] == &#039;=&#039; &amp;&amp; p[1] == &#039;?&#039;) { const char *q1 = strchr(p + 2, &#039;?&#039;); if (q1 &amp;&amp; (q1[1] == &#039;Q&#039; || q1[1] == &#039;q&#039; || q1[1] == &#039;B&#039; || q1[1] == &#039;b&#039;) &amp;&amp; q1[2] == &#039;?&#039;) { char enc = (char)toupper((unsigned char)q1[1]); const char *payload = q1 + 3; const char *end = strstr(payload, &quot;?=&quot;); if (end) { /* Strip inter-word whitespace between adjacent encoded words */ if (prev_was_encoded) { while (oi_clean &gt; 0 &amp;&amp; (out_clean[oi_clean - 1] == &#039; &#039; || out_clean[oi_clean - 1] == &#039;\t&#039;)) { oi_clean--; } while (oi_utf8 &gt; 0 &amp;&amp; (out_utf8[oi_utf8 - 1] == &#039; &#039; || out_utf8[oi_utf8 - 1] == &#039;\t&#039;)) { oi_utf8--; } } size_t plen = (size_t)(end - payload); unsigned char *tmp = (unsigned char *)malloc(plen + 4); if (tmp) { size_t dlen = (enc == &#039;Q&#039;) ? decode_qp(payload, plen, tmp) : decode_b64(payload, plen, tmp); process_utf8_chunk( tmp, dlen, out_clean, &amp;oi_clean, clean_max, out_utf8, &amp;oi_utf8, utf8_max, &amp;had_stripped ); free(tmp); } p = end + 2; prev_was_encoded = 1; continue; } } } unsigned char ch = (unsigned char)*p; if (ch != &#039; &#039; &amp;&amp; ch != &#039;\t&#039;) { prev_was_encoded = 0; } if (ch &lt; 0x80) { if (ch &gt;= 0x20 &amp;&amp; ch &lt;= 0x7E) { out_clean[oi_clean++] = (char)ch; if (oi_utf8 + 1 &lt; utf8_max) out_utf8[oi_utf8++] = (char)ch; } p++; } else { /* Handle unencoded 8-bit UTF-8 sequences directly in the Subject header */ size_t avail = strlen(p); size_t seq_len = 1; if ((ch &amp; 0xE0) == 0xC0 &amp;&amp; avail &gt;= 2) seq_len = 2; else if ((ch &amp; 0xF0) == 0xE0 &amp;&amp; avail &gt;= 3) seq_len = 3; else if ((ch &amp; 0xF8) == 0xF0 &amp;&amp; avail &gt;= 4) seq_len = 4; process_utf8_chunk( (const unsigned char *)p, seq_len, out_clean, &amp;oi_clean, clean_max, out_utf8, &amp;oi_utf8, utf8_max, &amp;had_stripped ); p += seq_len; } } while (oi_clean &gt; 0 &amp;&amp; (out_clean[oi_clean - 1] == &#039; &#039; || out_clean[oi_clean - 1] == &#039;\t&#039;)) { oi_clean--; } out_clean[oi_clean] = &#039;\0&#039;; while (oi_utf8 &gt; 0 &amp;&amp; (out_utf8[oi_utf8 - 1] == &#039; &#039; || out_utf8[oi_utf8 - 1] == &#039;\t&#039;)) { oi_utf8--; } out_utf8[oi_utf8] = &#039;\0&#039;; return had_stripped; } static void log_stripped_subject(const char *msg_path, const char *custom_log, const char *utf8_subj, const char *clean_subj) { char log_path[MAX_PATH_BUF]; if (custom_log &amp;&amp; custom_log[0] != &#039;\0&#039;) { snprintf(log_path, sizeof(log_path), &quot;%s&quot;, custom_log); } else { /* Place stripped_utf8.log in the same directory as the .CNM file */ snprintf(log_path, sizeof(log_path), &quot;%s&quot;, msg_path); char *slash1 = strrchr(log_path, &#039;/&#039;); char *slash2 = strrchr(log_path, &#039;\\&#039;); char *last_slash = (slash1 &gt; slash2) ? slash1 : slash2; if (last_slash) { *(last_slash + 1) = &#039;\0&#039;; strncat(log_path, &quot;stripped_utf8.log&quot;, sizeof(log_path) - strlen(log_path) - 1); } else { snprintf(log_path, sizeof(log_path), &quot;stripped_utf8.log&quot;); } } FILE *flog = fopen(log_path, &quot;ab&quot;); if (!flog) return; time_t now = time(NULL); struct tm *tm_info = localtime(&amp;now); char ts[32] = &quot;0000-00-00 00:00:00&quot;; if (tm_info) { strftime(ts, sizeof(ts), &quot;%Y-%m-%d %H:%M:%S&quot;, tm_info); } /* Extract just the filename for cleaner log entries */ const char *fname = msg_path; const char *s1 = strrchr(msg_path, &#039;/&#039;); const char *s2 = strrchr(msg_path, &#039;\\&#039;); if (s1 || s2) { fname = ((s1 &gt; s2) ? s1 : s2) + 1; } fprintf(flog, &quot;[%s] %s\n UTF-8 : %s\n Clean : %s\n\n&quot;, ts, fname, utf8_subj, clean_subj); fclose(flog); } /* Quick scan of headers to skip files that do not need updating */ static int file_needs_cleaning(const char *path) { FILE *f = fopen(path, &quot;rb&quot;); if (!f) return 0; char line[8192]; int in_subject = 0; int needs_work = 0; while (fgets(line, sizeof(line), f)) { size_t len = strlen(line); while (len &gt; 0 &amp;&amp; (line[len - 1] == &#039;\r&#039; || line[len - 1] == &#039;\n&#039;)) { line[--len] = &#039;\0&#039;; } if (len == 0) break; if (in_subject) { if (line[0] != &#039; &#039; &amp;&amp; line[0] != &#039;\t&#039;) { break; } } else if (starts_with_ci(line, &quot;Subject:&quot;)) { in_subject = 1; } if (in_subject) { if (strstr(line, &quot;=?&quot;) != NULL) { needs_work = 1; break; } for (size_t i = 0; i &lt; len; i++) { if ((unsigned char)line[i] &gt;= 0x80) { needs_work = 1; break; } } if (needs_work) break; } } fclose(f); return needs_work; } static int process_cnm_file(const char *path, const char *custom_log) { if (!file_needs_cleaning(path)) { return 0; } FILE *fin = fopen(path, &quot;rb&quot;); if (!fin) return -1; char tmp_path[MAX_PATH_BUF]; snprintf(tmp_path, sizeof(tmp_path), &quot;%s.tmp&quot;, path); FILE *fout = fopen(tmp_path, &quot;wb&quot;); if (!fout) { fclose(fin); return -1; } char line[8192]; char subj_raw[MAX_HDR_BUF]; char subj_clean[MAX_HDR_BUF]; char subj_utf8[MAX_HDR_BUF]; int in_subject = 0; int headers_done = 0; int detected_crlf = 1; while (fgets(line, sizeof(line), fin)) { if (!headers_done) { size_t len = strlen(line); int has_crlf = (len &gt;= 2 &amp;&amp; line[len - 2] == &#039;\r&#039; &amp;&amp; line[len - 1] == &#039;\n&#039;); if (len &gt;= 1) detected_crlf = has_crlf; while (len &gt; 0 &amp;&amp; (line[len - 1] == &#039;\r&#039; || line[len - 1] == &#039;\n&#039;)) { line[--len] = &#039;\0&#039;; } if (in_subject) { if (len &gt; 0 &amp;&amp; (line[0] == &#039; &#039; || line[0] == &#039;\t&#039;)) { const char *cont = line; while (*cont == &#039; &#039; || *cont == &#039;\t&#039;) cont++; size_t cur = strlen(subj_raw); if (cur + strlen(cont) + 2 &lt; sizeof(subj_raw)) { if (cur &gt; 0) strcat(subj_raw, &quot; &quot;); strcat(subj_raw, cont); } continue; } else { int had_stripped = clean_subject_value( subj_raw, subj_clean, sizeof(subj_clean), subj_utf8, sizeof(subj_utf8) ); if (had_stripped) { log_stripped_subject(path, custom_log, subj_utf8, subj_clean); } fprintf(fout, &quot;Subject: %s%s&quot;, subj_clean, detected_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); in_subject = 0; } } if (len == 0) { headers_done = 1; fprintf(fout, &quot;%s&quot;, detected_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); continue; } if (starts_with_ci(line, &quot;Subject:&quot;)) { const char *val = line + 8; while (*val == &#039; &#039; || *val == &#039;\t&#039;) val++; snprintf(subj_raw, sizeof(subj_raw), &quot;%s&quot;, val); in_subject = 1; continue; } fprintf(fout, &quot;%s%s&quot;, line, has_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); } else { fwrite(line, 1, strlen(line), fout); } } if (in_subject) { int had_stripped = clean_subject_value( subj_raw, subj_clean, sizeof(subj_clean), subj_utf8, sizeof(subj_utf8) ); if (had_stripped) { log_stripped_subject(path, custom_log, subj_utf8, subj_clean); } fprintf(fout, &quot;Subject: %s%s&quot;, subj_clean, detected_crlf ? &quot;\r\n&quot; : &quot;\n&quot;); } fclose(fin); fclose(fout); remove(path); if (rename(tmp_path, path) != 0) { return -1; } return 1; } int main(int argc, char *argv[]) { if (argc &lt; 2) { fprintf(stderr, &quot;Usage: %s &lt;mail_dir_or_file.cnm&gt; [logfile]\n&quot;, argv[0]); return 1; } char target[MAX_PATH_BUF]; snprintf(target, sizeof(target), &quot;%s&quot;, argv[1]); size_t tlen = strlen(target); while (tlen &gt; 1 &amp;&amp; (target[tlen - 1] == &#039;/&#039; || target[tlen - 1] == &#039;\\&#039;)) { target[--tlen] = &#039;\0&#039;; } const char *custom_log = (argc &gt;= 3) ? argv[2] : NULL; #ifdef _WIN32 DWORD attr = GetFileAttributesA(target); if (attr == INVALID_FILE_ATTRIBUTES) { fprintf(stderr, &quot;Error: Path not found: %s\n&quot;, target); return 1; } if (attr &amp; FILE_ATTRIBUTE_DIRECTORY) { char search_pattern[MAX_PATH_BUF]; snprintf(search_pattern, sizeof(search_pattern), &quot;%s\\*&quot;, target); WIN32_FIND_DATAA ffd; HANDLE hFind = FindFirstFileA(search_pattern, &amp;ffd); if (hFind == INVALID_HANDLE_VALUE) return 1; int cleaned_count = 0; do { if (ffd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) continue; if (ends_with_cnm_ci(ffd.cFileName)) { char full_path[MAX_PATH_BUF]; snprintf(full_path, sizeof(full_path), &quot;%s\\%s&quot;, target, ffd.cFileName); if (process_cnm_file(full_path, custom_log) == 1) { cleaned_count++; } } } while (FindNextFileA(hFind, &amp;ffd) != 0); FindClose(hFind); printf(&quot;Processed directory: %d file(s) updated.\n&quot;, cleaned_count); } else { process_cnm_file(target, custom_log); } #else struct stat st; if (stat(target, &amp;st) != 0) { fprintf(stderr, &quot;Error: Path not found: %s\n&quot;, target); return 1; } if (S_ISDIR(st.st_mode)) { DIR *dir = opendir(target); if (!dir) { fprintf(stderr, &quot;Error: Cannot open directory: %s\n&quot;, target); return 1; } struct dirent *ent; int cleaned_count = 0; while ((ent = readdir(dir)) != NULL) { if (strcmp(ent-&gt;d_name, &quot;.&quot;) == 0 || strcmp(ent-&gt;d_name, &quot;..&quot;) == 0) continue; if (ends_with_cnm_ci(ent-&gt;d_name)) { char full_path[MAX_PATH_BUF]; snprintf(full_path, sizeof(full_path), &quot;%s/%s&quot;, target, ent-&gt;d_name); struct stat fst; if (stat(full_path, &amp;fst) == 0 &amp;&amp; S_ISREG(fst.st_mode)) { if (process_cnm_file(full_path, custom_log) == 1) { cleaned_count++; } } } } closedir(dir); printf(&quot;Processed directory: %d file(s) updated.\n&quot;, cleaned_count); } else if (S_ISREG(st.st_mode)) { process_cnm_file(target, custom_log); } #endif return 0; } ```` Did try to add as externsion ot toolbar button, but nothing we (google ai) worked. Interesting. Didn&#039;t really look at code much, had done similar in past with other things.

mikes@guam.net

Discovered a lot messages have emoji's that don't show up at all looking at the stripped_utf8.log


6b0ae1e2698f4


Downloaded messages and run shell or batch file.
Lines that have emoji's but don't show on screen, but the program writes the original to log.
Had session where download 22 new messages. Script reported that 9 were changed. Had never seen these emoji's?
Interesting.


Discovered a lot messages have emoji&#039;s that don&#039;t show up at all looking at the stripped_utf8.log ![6b0ae1e2698f4](serve/attachment&amp;path=6b0ae1e2698f4) Downloaded messages and run shell or batch file. Lines that have emoji&#039;s but don&#039;t show on screen, but the program writes the original to log. Had session where download 22 new messages. Script reported that 9 were changed. Had never seen these emoji&#039;s? Interesting.

mikes@guam.net

I received an message this morning that displays in the Spam folder list with a blank From.


The From: header is:
From: =?utf-8?B?8J2WjvCdlpPwnZaY8J2WmfCdloZg8J2WjPCdlpfwnZaG8J2WkvCfqbc=?= yakhudmr@gageaspel.biz


which decodes as: 6b0b16b052886


I am fine with viewing the headers of these messages and then deciding whether to open them. Most (but not all) have been spam for me.


@msetzerii, does your script modify the source content. If so, that is a problem to me due to being averse to modifications of the source content. OTOH, a script that generates a modified copy, clearly marked as such, could be valuable until Pegasus Mail can gracefully handle utf-8 in message headers.

I received an message this morning that displays in the Spam folder list with a blank From. The From: header is: From: =?utf-8?B?8J2WjvCdlpPwnZaY8J2WmfCdloZg8J2WjPCdlpfwnZaG8J2WkvCfqbc=?= &lt;yakhudmr@gageaspel.biz&gt; which decodes as: ![6b0b16b052886](serve/attachment&amp;path=6b0b16b052886) I am fine with viewing the headers of these messages and then deciding whether to open them. Most (but not all) have been spam for me. @msetzerii, does your script modify the source content. If so, that is a problem to me due to being averse to modifications of the source content. OTOH, a script that generates a modified copy, clearly marked as such, could be valuable until Pegasus Mail can gracefully handle utf-8 in message headers.

did a scan of all my PMM file using command at end for TO: From: and Subject: lines with UTF-8?


     10 From: =?UTF-8?B?SmFrdWIgSG9ya8O9?= <jakub.git@horky.net>
10 From: =?UTF-8?Q?S=C3=B6ren?= Tempel <soeren@soeren-tempel.net>
10 Subject: =?UTF-8?Q?USPS=C2=AE_Expected_Delivery_by_Monday,_October_23,?=
10 Subject: =?UTF-8?Q?USPS=C2=AE_Expected_Delivery_by_Tuesday,_March_1,?=
10 To: =?UTF-8?B?SmFuIEtsw7Z0emtl?= <jan@kloetzke.net>
11 From: =?UTF-8?B?TWF4aW0gdmlhIFppbmlvIERpZ2l0YWwgTWFnYXppbmVz?=
11 Reply-To: =?UTF-8?B?TWF4aW0gdmlhIFppbmlvIERpZ2l0YWwgTWFnYXppbmVz?=
11 Subject: Re: 'case' UTF-8 bug
11 Subject: =?UTF-8?B?UGF0cmVvbjogJDUuMDDCoFVTRA==?=
11 Subject: =?UTF-8?Q?Re:_Shipping:_msetzerii_sent_a_mes?=
12 Subject: =?UTF-8?Q?Receipt_for_your_donation_to=C2=A0PayPal_Giving_Fund?=
12 To: =?UTF-8?Q?S=C3=B6ren_Tempel?= <soeren@soeren-tempel.net>
13 From: =?UTF-8?B?SmFrdWIgSG9ya8O9?= <jakub@horky.net>
13 Subject: =?UTF-8?B?R29vZ2xlOiAkMC45OcKgVVNE?=
13 To: =?UTF-8?Q?Dami=C3=A1n_Esteban_Cabral_<cabral.de@gmail.com>?=
14 From: =?UTF-8?B?Q3PDs2vDoXMgQmVuY2U=?= <csokas.bence@prolan.hu>
14 Subject: =?UTF-8?Q?Re=3A_=5Blibreoffice-users=5D_R=C3=BCckmeldung_zur_Kennze?=
14 Subject: =?UTF-8?Q?Tell_us_about_your_Experience._=C2=A0Be_heard.?=
14 Subject: =?UTF-8?Q?Updates_from_=E2=80=98PengPod_1040:_Quad_Core_Linux-?=
15 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= <jan@kloetzke.net>
15 Subject: =?UTF-8?Q?USPS=C2=AE_Arrived_at_USPS_Regional_Destin?=
15 To: =?UTF-8?Q?Tim_R=C3=BChsen_<tim.ruehsen@gmx.de>?=
16 From: =?UTF-8?B?RnLDqWTDqXJpYw==?= <ufospoke@gmail.com>
16 Subject: =?UTF-8?Q?USPS=C2=AE_Item_Delivered,_Individual_Picked_?=
16 To: =?UTF-8?Q?Tiffany_Rose_Mu=C3=B1a_Barnes_<munabarnes@guamcourts.org>?=
17 Subject: =?UTF-8?Q?=F0=9F=9A=9A_An_update_on_your_order?=
18 From: Peter M=?UTF-8?Q?=C3=A4urer?= <pi.daun@T-ONLINE.DE>
19 Subject: =?UTF-8?Q?Re:_notetopbook_sent_a_?= =?UTF-8?Q?message_abou?=
24 To: =?UTF-8?B?TWljaGFlbCBTZXR6ZXIgSUk=?= <mikes@kuentos.guam.net>
24 To: =?UTF-8?Q?LibreOffice_Anv=C3=A4ndare?= <users@global.libreoffice.org>
28 To: =?UTF-8?B?TWljaGFlbCBTZXR6ZXIgSWk=?= <mikes@kuentos.guam.net>
33 Reply-To: =?UTF-8?Q?Micha=C5=82_Trojnara?= <Michal.Trojnara@stunnel.org>
36 From: =?UTF-8?Q?Citi_ThankYou=C2=AE_Preferred_Card?=
38 From: =?UTF-8?Q?Fran=C3=A7ois_Patte?= <francois.patte@fdn.fr>
80 From: =?UTF-8?B?Q2l0aSBUaGFua1lvdcKuIFJld2FyZHMg?=
84 From: =?UTF-8?Q?Tim_R=C3=BChsen?= <tim.ruehsen@gmx.de>
227 Subject: =?UTF-8?Q?USPS=C2=AE_Item_Delivered,_Individual_Picked_Up?=
353 From: =?UTF-8?Q?Robert_Gro=C3=9Fkopf?= <robert@familiegrosskopf.de>
$ cat *.PMM | grep -a "To:\|From:\|Subject:" |grep -a "UTF-8" | sort | uniq -c |sort -n
did a scan of all my PMM file using command at end for TO: From: and Subject: lines with UTF-8? ```` 10 From: =?UTF-8?B?SmFrdWIgSG9ya8O9?= &lt;jakub.git@horky.net&gt; 10 From: =?UTF-8?Q?S=C3=B6ren?= Tempel &lt;soeren@soeren-tempel.net&gt; 10 Subject: =?UTF-8?Q?USPS=C2=AE_Expected_Delivery_by_Monday,_October_23,?= 10 Subject: =?UTF-8?Q?USPS=C2=AE_Expected_Delivery_by_Tuesday,_March_1,?= 10 To: =?UTF-8?B?SmFuIEtsw7Z0emtl?= &lt;jan@kloetzke.net&gt; 11 From: =?UTF-8?B?TWF4aW0gdmlhIFppbmlvIERpZ2l0YWwgTWFnYXppbmVz?= 11 Reply-To: =?UTF-8?B?TWF4aW0gdmlhIFppbmlvIERpZ2l0YWwgTWFnYXppbmVz?= 11 Subject: Re: &#039;case&#039; UTF-8 bug 11 Subject: =?UTF-8?B?UGF0cmVvbjogJDUuMDDCoFVTRA==?= 11 Subject: =?UTF-8?Q?Re:_Shipping:_msetzerii_sent_a_mes?= 12 Subject: =?UTF-8?Q?Receipt_for_your_donation_to=C2=A0PayPal_Giving_Fund?= 12 To: =?UTF-8?Q?S=C3=B6ren_Tempel?= &lt;soeren@soeren-tempel.net&gt; 13 From: =?UTF-8?B?SmFrdWIgSG9ya8O9?= &lt;jakub@horky.net&gt; 13 Subject: =?UTF-8?B?R29vZ2xlOiAkMC45OcKgVVNE?= 13 To: =?UTF-8?Q?Dami=C3=A1n_Esteban_Cabral_&lt;cabral.de@gmail.com&gt;?= 14 From: =?UTF-8?B?Q3PDs2vDoXMgQmVuY2U=?= &lt;csokas.bence@prolan.hu&gt; 14 Subject: =?UTF-8?Q?Re=3A_=5Blibreoffice-users=5D_R=C3=BCckmeldung_zur_Kennze?= 14 Subject: =?UTF-8?Q?Tell_us_about_your_Experience._=C2=A0Be_heard.?= 14 Subject: =?UTF-8?Q?Updates_from_=E2=80=98PengPod_1040:_Quad_Core_Linux-?= 15 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= &lt;jan@kloetzke.net&gt; 15 Subject: =?UTF-8?Q?USPS=C2=AE_Arrived_at_USPS_Regional_Destin?= 15 To: =?UTF-8?Q?Tim_R=C3=BChsen_&lt;tim.ruehsen@gmx.de&gt;?= 16 From: =?UTF-8?B?RnLDqWTDqXJpYw==?= &lt;ufospoke@gmail.com&gt; 16 Subject: =?UTF-8?Q?USPS=C2=AE_Item_Delivered,_Individual_Picked_?= 16 To: =?UTF-8?Q?Tiffany_Rose_Mu=C3=B1a_Barnes_&lt;munabarnes@guamcourts.org&gt;?= 17 Subject: =?UTF-8?Q?=F0=9F=9A=9A_An_update_on_your_order?= 18 From: Peter M=?UTF-8?Q?=C3=A4urer?= &lt;pi.daun@T-ONLINE.DE&gt; 19 Subject: =?UTF-8?Q?Re:_notetopbook_sent_a_?= =?UTF-8?Q?message_abou?= 24 To: =?UTF-8?B?TWljaGFlbCBTZXR6ZXIgSUk=?= &lt;mikes@kuentos.guam.net&gt; 24 To: =?UTF-8?Q?LibreOffice_Anv=C3=A4ndare?= &lt;users@global.libreoffice.org&gt; 28 To: =?UTF-8?B?TWljaGFlbCBTZXR6ZXIgSWk=?= &lt;mikes@kuentos.guam.net&gt; 33 Reply-To: =?UTF-8?Q?Micha=C5=82_Trojnara?= &lt;Michal.Trojnara@stunnel.org&gt; 36 From: =?UTF-8?Q?Citi_ThankYou=C2=AE_Preferred_Card?= 38 From: =?UTF-8?Q?Fran=C3=A7ois_Patte?= &lt;francois.patte@fdn.fr&gt; 80 From: =?UTF-8?B?Q2l0aSBUaGFua1lvdcKuIFJld2FyZHMg?= 84 From: =?UTF-8?Q?Tim_R=C3=BChsen?= &lt;tim.ruehsen@gmx.de&gt; 227 Subject: =?UTF-8?Q?USPS=C2=AE_Item_Delivered,_Individual_Picked_Up?= 353 From: =?UTF-8?Q?Robert_Gro=C3=9Fkopf?= &lt;robert@familiegrosskopf.de&gt; $ cat *.PMM | grep -a &quot;To:\|From:\|Subject:&quot; |grep -a &quot;UTF-8&quot; | sort | uniq -c |sort -n ````

mikes@guam.net

working with a stripchar5.cpp that looks at headers other than just Subject:


Doing testing on it.


working with a stripchar5.cpp that looks at headers other than just Subject: Doing testing on it.

mikes@guam.net

until Pegasus Mail can gracefully handle utf-8 in message headers.


Just to stay correct: Pegasus Mail can handle UTF-8 in headers but the font being used can't display emojis: I just created a message using German umlauts and the "ß" in the to, from and subject headers which are properly decoded and displayed (4 characters in total, base64 encoded into 12 characters). It works properly in all locations: new mail folder, regular folder, header display in reader window and on title bars and preview's details ribbon.


And with regard to the header you decoded, Brian, it actually decodes to �����`�����. If decoded by PM's own reader it only displays the characters, not the emoticon. The font being used here has been copied from my enhanced plain text editor, in TER it uses the default font. The Unicode value of the emoticon is 0xDE77.


Well, here's what it looks like in the forum editor within Firefox (screenshot):


6b0b96cec358a


[quote=&quot;pid:59456, uid:28772&quot;]until Pegasus Mail can gracefully handle utf-8 in message headers.[/quote] Just to stay correct: Pegasus Mail can handle UTF-8 in headers but the font being used can&#039;t display emojis: I just created a message using German umlauts and the &quot;&szlig;&quot; in the to, from and subject headers which are properly decoded and displayed (4 characters in total, base64 encoded into 12 characters). It works properly in all locations: new mail folder, regular folder, header display in reader window and on title bars and preview&#039;s details ribbon. And with regard to the header you decoded, Brian, it actually decodes to �����`�����. If decoded by PM&#039;s own reader it only displays the characters, not the emoticon. The font being used here has been copied from my enhanced plain text editor, in TER it uses the default font. The Unicode value of the emoticon is 0xDE77. Well, here&#039;s what it looks like in the forum editor within Firefox (screenshot): ![6b0b96cec358a](serve/attachment&amp;path=6b0b96cec358a)
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C
edited 2 hours ago

could you send to me directly the email with the characters.
I have gone thru some more modifications on the stripchar7 now program, and would to see what it might do.


It removes emoji's but it does convert some encoded characters to regular ones?


Seems Pegasus uses wine-tahoma-fonts-system, so don't know details.


could you send to me directly the email with the characters. I have gone thru some more modifications on the stripchar7 now program, and would to see what it might do. It removes emoji&#039;s but it does convert some encoded characters to regular ones? Seems Pegasus uses wine-tahoma-fonts-system, so don&#039;t know details.

mikes@guam.net

could you send to me directly the email with the characters.


The Email with which characters? The German or Brian's?


It removes emoji's but it does convert some encoded characters to regular ones?


Is this a question or a statement?


Seems Pegasus uses wine-tahoma-fonts-system, so don't know details.


This depends on the Windows version as far as its controls and dialogs are concerned. There's a standard name for system fonts which is mapped to the currently used default. Wine apparently uses outdated ones. The current default is Segoe UI.


[quote=&quot;pid:59464, uid:2546&quot;]could you send to me directly the email with the characters.[/quote] The Email with which characters? The German or Brian&#039;s? [quote=&quot;pid:59464, uid:2546&quot;]It removes emoji&#039;s but it does convert some encoded characters to regular ones?[/quote] Is this a question or a statement? [quote=&quot;pid:59464, uid:2546&quot;]Seems Pegasus uses wine-tahoma-fonts-system, so don&#039;t know details.[/quote] This depends on the Windows version as far as its controls and dialogs are concerned. There&#039;s a standard name for system fonts which is mapped to the currently used default. Wine apparently uses outdated ones. The current default is Segoe UI.
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C
edited 11 hours ago

cat /tmp/x.sh


Search ASCII strings


strings -n 5 WINPM-32.EXE | grep -iE "tahoma|arial|segoe|sans|font"


Search UTF-16LE strings (standard for Windows GUI dialog resources)


strings -e l -n 5 WINPM-32.EXE | grep -iE "tahoma|arial|segoe|sans|font"
root@setzcodell:/home/msetzerii/.wine/drive_c/PMAIL/Programs# /tmp/x.sh
Arial
Arial
Arial
Tahoma Unicode
FPFONTS
FontName
FontSize
Arial
FontName
FontName
FontName
FontSize
FONTFAMILY
Arial
Arial
MS Sans Serif
FONTFAMILY
FONTFAMILY


<FontFamily><param>%s</param>
Characters and Font IDs:




---------- Font IDs: ----------
Font ID %d:
Font face: %s
MS Sans Serif
SELFONT
set_tabctrl_font
set_headctrl_font
bmb_set_default_font
bmb_get_default_font
set_dialog_font
CreateFontIndirectA
CreateFontA
EnumFontsA
Tahoma




# cat /tmp/x.sh # Search ASCII strings strings -n 5 WINPM-32.EXE | grep -iE &quot;tahoma|arial|segoe|sans|font&quot; # Search UTF-16LE strings (standard for Windows GUI dialog resources) strings -e l -n 5 WINPM-32.EXE | grep -iE &quot;tahoma|arial|segoe|sans|font&quot; root@setzcodell:/home/msetzerii/.wine/drive_c/PMAIL/Programs# /tmp/x.sh Arial Arial Arial Tahoma Unicode FPFONTS FontName FontSize Arial FontName FontName FontName FontSize FONTFAMILY Arial Arial MS Sans Serif FONTFAMILY FONTFAMILY &lt;FontFamily&gt;&lt;param&gt;%s&lt;/param&gt; Characters and Font IDs: &gt;&gt;---------- Font IDs: ---------- Font ID %d: Font face: %s MS Sans Serif SELFONT set_tabctrl_font set_headctrl_font bmb_set_default_font bmb_get_default_font set_dialog_font CreateFontIndirectA CreateFontA EnumFontsA Tahoma

mikes@guam.net

Program would not let me paste?


stripchar7.pdf


Would not let me upload cpp files, so converted to pdf which it let update.


Program would not let me paste? [stripchar7.pdf](serve/attachment&amp;path=6b0bb4ee9170b) Would not let me upload cpp files, so converted to pdf which it let update.

mikes@guam.net

(Would you believe what this thread, concerning only truncation errors in any long utf-8 strings has come to?)


99,9% of your answers are off-topic I think and should rather be posted to any Windows forum, as they are only about how to make emojis visible on your system.


Whereas my initial and only concern it was, that the names of my mail partners with non-latin characters are not showing up at all.


I've always felt that introducing emojis into the Unicode realm was a really, really bad idea.


Steffen


(Would you believe what this thread, concerning only **truncation errors in any long utf-8 strings** has come to?) 99,9% of your answers are off-topic I think and should rather be posted to any Windows forum, as they are only about how to make emojis visible on your system. Whereas my initial and only concern it was, that the names of my mail partners with non-latin characters are not showing up at all. I&#039;ve always felt that introducing emojis into the Unicode realm was a really, really bad idea. Steffen
edited 4 hours ago

reset my log file, and these are some of things I am seeing.


cat stripped_utf8.log
[2026-11-29 13:19:16] PB4SPFSY.CNM (From:)
Orig : =?ISO-8859-1?B?TlYgRW5lcmd5?= <alerts@cs.nvenergy.com>
Clean : NV Energy <alerts@cs.nvenergy.com>

[2026-11-29 13:19:16] PB4SPFSY.CNM (Reply-To:)
Orig : =?ISO-8859-1?B?TlYgRW5lcmd5?= <CustomerService@nvenergy.com>
Clean : NV Energy <CustomerService@nvenergy.com>

[2026-11-29 13:45:32] P1DGH7EK.CNM (Subject:)
Orig : =?UTF-8?B?VGhlIERTQeKAmXMgRElSVFkgc2VjcmV0IHRvIHBvd2Vy?=
Clean : The DSA's DIRTY secret to power

[2026-11-29 13:45:32] PB9GKG0W.CNM (Subject:)
Orig : =?UTF-8?q?Don'
t_Miss_Out:_Fairy_Tales_of_Terror:_#1_&_2_-_Psycho_Cinderel?= =?UTF-8?q?la_is_BACK!!_ends_soon_=E2=8F=B3?=
Clean : Don't Miss Out: Fairy Tales of Terror: #1 & 2 - Psycho Cinderella is BACK!! ends soon

[2026-11-29 13:45:32] P3O8ZU5W.CNM (From:)
Orig : =?UTF-8?Q?cs?= <cs@mail.gofo.com>
Clean : cs <cs@mail.gofo.com>

[2026-11-29 13:45:32] P3O8ZU5W.CNM (To:)
Orig : =?UTF-8?Q?mikes?= <mikes@guam.net>
Clean : mikes <mikes@guam.net>

[2026-11-29 13:45:32] P9I2F6FD.CNM (Subject:)
Orig : =?us-ascii?Q?Long_UTF-8_clobbered_in_message_properties_-_ne?= =?us-ascii?Q?w_reply?=
Clean : Long UTF-8 clobbered in message properties - new reply

[2026-11-29 13:45:32] P7Y4ZUNX.CNM (Subject:)
Orig : =?utf-8?B?U2hvcCBCbGFjayBGcmlkYXkgTWF0dHJlc3MgVG9wcGVyICYgTWF0dHJlc3NlcyBC?= =?utf-8?B?ZWZvcmUgVGhleeKAmXJlIEdvbmUh?=
Clean : Shop Black Friday Mattress Topper & Mattresses Before They'
re Gone!

[2026-11-29 20:43:28] PBG8XDIM.CNM (Subject:)
Orig : =?utf-8?b?8J+SnSBTdVBFUklvciBTdW5kYXkgU2FsZSDwn5Kd?=
Clean : SuPERIor Sunday Sale

[2026-11-29 22:51:49] PFRJ7G17.CNM (Subject:)
Orig : =?us-ascii?Q?Pegasus_(under_Windows_11)_freezes_whenever_I_t?= =?us-ascii?Q?ry_to_create__a_new_folder_or_tray_-_new_reply?=
Clean : Pegasus (under Windows 11) freezes whenever I try to create a new folder or tray - new reply

[2026-11-29 22:51:49] PYINNMJC.CNM (Subject:)
Orig : =?us-ascii?Q?Long_UTF-8_clobbered_in_message_properties_-_ne?= =?us-ascii?Q?w_reply?=
Clean : Long UTF-8 clobbered in message properties - new reply

[2026-11-29 22:51:49] PCDADT2J.CNM (Subject:)
Orig : It all starts =?UTF-8?B?dG9kYXnigKY=?=
Clean : It all starts today...

[2026-11-29 22:51:49] P6JUUD7W.CNM (Subject:)
Orig : =?UTF-8?Q?Excel_features_I_miss_every_time_I_use_Goo?= =?UTF-8?Q?gle_Sheets_=E2=80=94_Do_a_quick_Pi-hole_IPv6_check?=
Clean : Excel features I miss every time I use Google Sheets - Do a quick Pi-hole IPv6 check
reset my log file, and these are some of things I am seeing. ```` cat stripped_utf8.log [2026-11-29 13:19:16] PB4SPFSY.CNM (From:) Orig : =?ISO-8859-1?B?TlYgRW5lcmd5?= &lt;alerts@cs.nvenergy.com&gt; Clean : NV Energy &lt;alerts@cs.nvenergy.com&gt; [2026-11-29 13:19:16] PB4SPFSY.CNM (Reply-To:) Orig : =?ISO-8859-1?B?TlYgRW5lcmd5?= &lt;CustomerService@nvenergy.com&gt; Clean : NV Energy &lt;CustomerService@nvenergy.com&gt; [2026-11-29 13:45:32] P1DGH7EK.CNM (Subject:) Orig : =?UTF-8?B?VGhlIERTQeKAmXMgRElSVFkgc2VjcmV0IHRvIHBvd2Vy?= Clean : The DSA&#039;s DIRTY secret to power [2026-11-29 13:45:32] PB9GKG0W.CNM (Subject:) Orig : =?UTF-8?q?Don&#039;t_Miss_Out:_Fairy_Tales_of_Terror:_#1_&amp;_2_-_Psycho_Cinderel?= =?UTF-8?q?la_is_BACK!!_ends_soon_=E2=8F=B3?= Clean : Don&#039;t Miss Out: Fairy Tales of Terror: #1 &amp; 2 - Psycho Cinderella is BACK!! ends soon [2026-11-29 13:45:32] P3O8ZU5W.CNM (From:) Orig : =?UTF-8?Q?cs?= &lt;cs@mail.gofo.com&gt; Clean : cs &lt;cs@mail.gofo.com&gt; [2026-11-29 13:45:32] P3O8ZU5W.CNM (To:) Orig : =?UTF-8?Q?mikes?= &lt;mikes@guam.net&gt; Clean : mikes &lt;mikes@guam.net&gt; [2026-11-29 13:45:32] P9I2F6FD.CNM (Subject:) Orig : =?us-ascii?Q?Long_UTF-8_clobbered_in_message_properties_-_ne?= =?us-ascii?Q?w_reply?= Clean : Long UTF-8 clobbered in message properties - new reply [2026-11-29 13:45:32] P7Y4ZUNX.CNM (Subject:) Orig : =?utf-8?B?U2hvcCBCbGFjayBGcmlkYXkgTWF0dHJlc3MgVG9wcGVyICYgTWF0dHJlc3NlcyBC?= =?utf-8?B?ZWZvcmUgVGhleeKAmXJlIEdvbmUh?= Clean : Shop Black Friday Mattress Topper &amp; Mattresses Before They&#039;re Gone! [2026-11-29 20:43:28] PBG8XDIM.CNM (Subject:) Orig : =?utf-8?b?8J+SnSBTdVBFUklvciBTdW5kYXkgU2FsZSDwn5Kd?= Clean : SuPERIor Sunday Sale [2026-11-29 22:51:49] PFRJ7G17.CNM (Subject:) Orig : =?us-ascii?Q?Pegasus_(under_Windows_11)_freezes_whenever_I_t?= =?us-ascii?Q?ry_to_create__a_new_folder_or_tray_-_new_reply?= Clean : Pegasus (under Windows 11) freezes whenever I try to create a new folder or tray - new reply [2026-11-29 22:51:49] PYINNMJC.CNM (Subject:) Orig : =?us-ascii?Q?Long_UTF-8_clobbered_in_message_properties_-_ne?= =?us-ascii?Q?w_reply?= Clean : Long UTF-8 clobbered in message properties - new reply [2026-11-29 22:51:49] PCDADT2J.CNM (Subject:) Orig : It all starts =?UTF-8?B?dG9kYXnigKY=?= Clean : It all starts today... [2026-11-29 22:51:49] P6JUUD7W.CNM (Subject:) Orig : =?UTF-8?Q?Excel_features_I_miss_every_time_I_use_Goo?= =?UTF-8?Q?gle_Sheets_=E2=80=94_Do_a_quick_Pi-hole_IPv6_check?= Clean : Excel features I miss every time I use Google Sheets - Do a quick Pi-hole IPv6 check ````

mikes@guam.net

12
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft