What is Nostr?
Joel Bennett /
npub18dq…9qnp
2024-10-21 06:40:35

Joel Bennett on Nostr: I've been playing with strings in #dotnet and #PowerShell trying to determine how ...

I've been playing with strings in #dotnet and #PowerShell trying to determine how long strings are (or appear to be), in a terminal.

As an exercise, I tried to make Windows PowerShell compatible version of Measure-String that:

1. Properly ignores ANSI escape sequences (better than current $Host.UI.RawUI.LengthInBufferCells)
2. Properly account for UAX29 (e.g. the 19-char long 👨🏻‍👩🏼‍👧🏼‍👧🏼 emoji)

#ProTip: it's not worth it to try and do _ANYTHING_ in Unicode in .NET Framework 4.x
Author Public Key
npub18dqdtq38873745nxtqa2z54d6pfagzhespenkvqcwqsmyrlyp9rsqy9qnp