:: Re: [DNG] No-break space [Was: Non …
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Didier Kryn
Ημερομηνία:  
Προς: dng
Παλιά Θέματα: Re: [DNG] Non-breakable space [Was: .mailcap entry for text/html mutt reading HTML emails]
Αντικείμενο: Re: [DNG] No-break space [Was: Non breakable space]
Le 22/11/2025 à 11:50, Antoine a écrit :
> On Saturday, 22 November at 11:43, Didier Kryn wrote:
>>     Sorry if I sometimes send messages with some HTML mark-up. I
>> consider that emphazis or bold improve readability. Another issue is
>> with non-breakable space because equations, for example, should
>> rather not be broken. I have tried to use Unicode's unbreakable
>> spaces, but Thunderbird seems to treat them like ordinary spaces,
>> while it respects HTML's  
>>
>>     Anyone has experience non-breakable spaces?
>>
>> --     Didier
>
> Depending on how important it is, and how readable you want it, you
> can base64-encode the fragile bits. Base64-encoding doesn't care about
> line breaks in the output, but conserves them very well in the input.
>
> The receiver will have to base64-decode those bits in that case, of
> course.


    Sorry: the name is "no-break space", not "non-breakable space".
There are variations of no-break space, "thin", "narrow", and many
others, but the simplest one, Unicode U+00A0 has the same size as the
ordinary space (ASCII 040) and translates to utf-8 as the two-bytes
code 0302 0240. It is displayed exactly like an ASCII space, but the
text processors, which care to not break words should treat it as if the
two words joined by a no-break space are actually one single word.

    Sure byte64 can do it as well as  . But, given the fact that
byte64 can contain anything, including images, I bet only the HTML
rendering engines can display it. It is possible also to make the
formula an inline SVG image, but this also requires HTML rendering, and
the simplest is  . Or you can replace   with utf-8 no-break
space, provided it is within HTML.

    My experiments show that Xfce4-terminal and the clipboard preserve
the utf-8 code. Of course the terminal emulator is not a word processor
and breaks lines even in the middle of a word; therefore it treats
no-break space as any other character. But Thunderbird converts it to
ascii space when I paste it from the clipboard, while it preserves
printable utf-8 characters like œ, 石 or ⵣ, as you can see.

--     Didier