Subject: bug#50983: 28.0.50; [REGRESSION, BUG] Display bugs with uncommon characters

From: Rudi C <[email-masked]>
Date: Sun, 3 Oct 2021 02:20:24 +0330

I have two display bugs to report, one a regression that is not present in
emacs 27. I start with this regression.

1. `curl https://files.lilf.ir/tmp/weird.txt > weird.txt`
2. `emacs -Q -nw weird.txt`
3. try editing the text, deleting characters, etc. The character display
will get messed up.

Here is a screenshot of emacs before editing the file:

https://files.lilf.ir/tmp/tmp.kik6vbBw8S.png

And here is a screenshot after I do `backspace a`:
https://files.lilf.ir/tmp/tmp.Twz5ZXVbR6.png

I have tried this bug with emacs 27 (both myself and some other user on
IRC), and it is not present there.

The second bug:
1. `curl https://files.lilf.ir/tmp/bug.txt > bug.txt`
2. do `cat bug.txt` and note the output:
https://files.lilf.ir/tmp/tmp.HKfKc9PUds.png

3. `emacs -Q -nw bug.txt`
As you can see, emacs is displaying the file incorrectly:
https://files.lilf.ir/tmp/tmp.0yKbCbB80R.png

In particular, the line `#+TITLE: sharif/contact info` is not displayed at
all.

I could reproduce this bug on both emacs 27 and 28.

Additional info:

In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.3.0, NS appkit-2022.30
Version 11.2.1 (Build 20D75))
 of 2021-09-21 built on Fereidoons-MacBook-Pro.local
System Description:  macOS 11.2.1

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-plus@28/28.0.50/share/info/emacs
 --prefix=/usr/local/Cellar/emacs-plus@28/28.0.50 --with-xml2
 --with-gnutls --with-native-compilation --without-dbus
 --with-imagemagick --with-modules --with-rsvg --with-xwidgets --with-ns
 --disable-ns-self-contained 'CFLAGS=-I/usr/local/opt/gcc/include
 -I/usr/local/opt/libgccjit/include -I/usr/local/opt/gmp/include
 -I/usr/local/opt/jpeg/include' 'LDFLAGS=-L/usr/local/lib/gcc/11
 -I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include
 -I/usr/local/opt/gmp/include -I/usr/local/opt/jpeg/include''

Configured features:
ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF
TOOLKIT_SCROLL_BARS XIM XWIDGETS ZLIB

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix