diff --git a/Pwsh/Unicode/UtilsForUnicodeStrings.psm1 b/Pwsh/Unicode/UtilsForUnicodeStrings.psm1 index 07c5654..ba5a04f 100644 --- a/Pwsh/Unicode/UtilsForUnicodeStrings.psm1 +++ b/Pwsh/Unicode/UtilsForUnicodeStrings.psm1 @@ -1,4 +1,6 @@ -function UnicodeLength { +# Text.Rune and other features used require Pwsh7+ + + function UnicodeLength { <# .SYNOPSIS this gives the "length" of a string in terms of codepoints (aka runes) @@ -30,6 +32,14 @@ function ShowHex { # $Input | join-string -f '{0:x}' } +filter ShowUni { + # sugar. nothing to see here... + ($_ ?? '').EnumerateRunes() + | Join-string -f "`n- {0}" -p { + $_.Value.ToString('x'), $_ + } +} + $script:Enc8 = [Text.Encoding]::GetEncoding('utf-8') $script:Enc16 = [Text.Encoding]::GetEncoding('utf-16le')