💾 Archived View for rawtext.club › ~sloum › geminilist › 000352.gmi captured on 2020-09-24 at 02:37:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

<-- back to the mailing list

Text reflow woes (or: I want bullets back!)y

Michael Lazar lazar.michael22 at gmail.com

Sat Jan 18 05:02:42 GMT 2020

- - - - - - - - - - - - - - - - - - - ```

On Thu, Jan 16, 2020 at 5:12 PM solderpunk <solderpunk at sdf.org> wrote:
>
> On Thu, Jan 16, 2020 at 01:09:18PM -0800, Aaron Janse wrote:
> 
> Oops, I meant to mention two things:
> 
> 1. Clients are already using TLS. I think wrapping is significantly
> 
>    easier than encryption.
>
> I was about to quip that the TLS is made really easy by high-level
> library support while the wrapping has to be done manually, but then I
> thought to check and, holy heck, Python has a `textwrap` module I wasn't
> aware of.

Python's textwrap module is fundamentally flawed for unicode and they have nointention of ever fixing it [0]. Once you start going down the rabbit hole ofCJK characters, emojis, grapheme clusters, etc. it becomes exceedingly hardto figure out how to correctly determine the width of unicode text. You canget it working 99% of the time, but there's always those fringe cases thatno one thinks about until somebody files a bug report.

I don't know if this has any bearing on the discussion, but it's worth keepingin the back of your mind if you intend to make unicode a first-class citizen.I would be cautious about calling text wrapping "significantly" easier than TLSor anything else for that matter. This was actually one of the things that drewme to gopher in the first place, I could assume everything was ASCII and throwall of that complexity out the window.

[0] https://bugs.python.org/issue24665