mail icon indicating copy to clipboard operation
mail copied to clipboard

Composing plain text introduces NBSP characters

Open virgo47 opened this issue 9 months ago • 0 comments

Steps to reproduce

  1. Start New message, leave it in plain-text (no formatting toolbar).
  2. Write email with some leading spaces (indented lines) or multiple spaces in the middle of the line.
  3. Send the mail to yourself.
  4. Open the mail when delivered and download the EML file (or use View source, but that one introduces empty lines when copy/paste is used) - the steps are: ... on the message, ... More actions, Download message
  5. Check the content, it is not intended plain text because it placed sneaky NBSP characters (see below).

Expected behavior

Plain text mail should preserve all the characters as-is, spaces as spaces, not introduce NBSP to "preserve" formatting even in HTML output. This solves the plaintext only from Nextcloud mail for Nextcloud mail viewer, but it does not preserve plaintext formatting for mails sent from elsewhere.

Actual behavior

The mail content produces something like this:

Content-Type: text/plain; charset=utf-8
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

one
=C2=A0two =C2=A0 here
=C2=A0 =C2=A0three

It is quoted-printable for no good reason, because some spaces were replaced with =C2=A0 during the message creation.

Mail app version

4.2.6

Nextcloud version

31.0.1

Mailserver or service

Zimbra 8.x

Operating system

Ubuntu 24.04.2 LTS

PHP engine version

PHP 8.3

Nextcloud memory caching

No response

Web server

Apache (supported)

Database

PostgreSQL

Additional info

No response

virgo47 avatar Mar 20 '25 10:03 virgo47