Skip to content

Commit 68cac55

Browse files
committed
the non_ascii filter needs to ignore the 0x0d and 0x0a (\n\r) chars
as they are not yet deleted when invoking this function
1 parent a598848 commit 68cac55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/string.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ int i18n_replace_non_ascii_chars(char *string)
461461
int count = 0;
462462

463463
while (*ptr) {
464-
if (!isascii(*ptr) || *ptr < 0x20) {
464+
if (!isascii(*ptr) ||
465+
(*ptr < 0x20 && *ptr != 0x0a && *ptr != 0x0d)) {
465466
*ptr = '?';
466467
count++;
467468
}

0 commit comments

Comments
 (0)