diff --git a/src/gmnlm.c b/src/gmnlm.c

index c70a4126acc5337a768c3a70513aecc1b0e16668..95b85fedd9fb84b50bf1c8a89be94daaeb99a4a6 100644

--- a/src/gmnlm.c

+++ b/src/gmnlm.c

@@ -730,6 +730,9 @@ case '\r':

if (!s[i+1]) break;

/* fallthrough */

default:

+ // skip unicode continuation bytes

+ if ((s[i] & 0xc0) == 0x80) break;

+

if (iscntrl(s[i])) {

s[i] = '.';

}