0

Too many times I find myself googling "Unicode " to find a Unicode character suitable for my needs. I'm now trying to replace that silly procedure with something more reproducible and reliable, so I'm looking for a Unicode character picker that works offline on Windows.

Requirements:

  • pick Unicode characters by scrolling through them
  • support typing descriptive names like "cross" or "box"
  • works offline, i.e. locally installs its own Unicode database
  • works on Windows
  • is gratis
  • no ads; donation button is acceptable

Ideal:

  • Regions like "math symbols", "greek" or similar as in Microsoft Word.

Optional:

  • LaTeX support, e.g. search for "alpha", find lower case α and upper case Α, Latex \alpha and \Alpha, respectively.

I've tried:

  • Win+., but it's too focused on Emojis
  • builtin Windows tool charmap, but it can scroll only. Searching by descriptive name is not possible
  • Microsoft Word symbol table, but it can scroll only. Searching by descriptive name is not possible. At least is has regions like "math".
  • this question is almost identical but for Linux. In addition, I don't necessarily need LaTeX support, although it would really be nice.
  • Lintalist as suggested here, but it does too much. I prefer a dedicated tool.
  • the R12A Unicode pickers are all online

1 Answer 1

1

This is a simple PowerShell script and isn't a full-fledged app but it satisfies most of your requirements

Sample GUI output:

Select-UniChar "math.*bold.*italic" | Out-GridView GUI result

Sample console output:

PS D:\Unicode> Select-UniChar "cross.*mark|check" | Select-Object -First 8

Character Designation Name
--------- ----------- ----
⍻         U+237B      NOT CHECK MARK
⑇         U+2447      OCR AMOUNT OF CHECK
☑         U+2611      BALLOT BOX WITH CHECK
✅         U+2705      WHITE HEAVY CHECK MARK
✓         U+2713      CHECK MARK
✔         U+2714      HEAVY CHECK MARK
❌         U+274C      CROSS MARK
❎         U+274E      NEGATIVE SQUARED CROSS MARK

PS D:\Unicode> Select-UniChar "alpha" | Select-Object -First 8

Character Designation Name
--------- ----------- ----
ɑ         U+0251      LATIN SMALL LETTER ALPHA
ɒ         U+0252      LATIN SMALL LETTER TURNED ALPHA
Ά         U+0386      GREEK CAPITAL LETTER ALPHA WITH TONOS
Α         U+0391      GREEK CAPITAL LETTER ALPHA
ά         U+03AC      GREEK SMALL LETTER ALPHA WITH TONOS
α         U+03B1      GREEK SMALL LETTER ALPHA
ᵅ         U+1D45      MODIFIER LETTER SMALL ALPHA
ᶐ         U+1D90      LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK

How to make it work

  1. In PowerShell run explorer (Get-ChildItem $PROFILE).Directory to open the profile folder

  2. Download the latest UnicodeData.txt from the Unicode database and save to the above folder

  3. Run Notepad $PROFILE and add the below lines to the end

    function Select-UniChar([string]$pattern) {
        Select-String $pattern .\UnicodeData.txt | ForEach-Object {
            $start = $_.Line.IndexOf(';')
            $end = $_.Line.IndexOf(';', $start + 1)
            $codepoint = $_.Line.Substring(0, $start)
    
            [PSCustomObject]@{
                Character = [char]::ConvertFromUtf32([uint32]"0x$codepoint")
                Designation = "U+" + $codepoint
                Name = $_.Line.Substring($start + 1, $end - $start - 1)
            }
        }
    }
    
  4. Now every time you open PowerShell you can use Select-UniChar function to find the characters. For example Select-UniChar "dash"

    You can run . $profile to source the updated profile to make the new code available immediately in the current shell

The function receives a regex so you'll need some regex knowledge for advanced searching, but it's trivial to change the script to do a wildcard match or a simple text match

If you want to have a GUI view to scroll, filter, etc. then pass the output to Out-GridView, for example

Select-UniChar 'arrow' | Out-GridView

Note that lots of characters won't be displayable if you use the default terminal for PowerShell. You must use Windows Terminal or a better terminal instead, and possibly install more fonts to show more Unicode characters. Anyway regardless of how it's shown in the terminal, copying it still works perfectly

Limitations:

  • The output isn't sorted by usage frequency like when you press Windows+. or Windows+; because that obviously requires a much more complex solution that may need to run as a service

  • It doesn't work for characters that are combined from multiple code points, for example many characters in complex scripts like Arabic or Indic, or emojis such as

    🏃🏻‍♀️🐱‍😶‍ 🇻🇳🇺🇸🇬🇧🇯🇵🇩🇪🇫🇷🇪🇺🇺🇳⚑🏴‍☠️⚧🏳️‍⚧️🏩💓👨‍❤️‍👨👩🏼‍❤️‍👨🏽👩🏻‍❤️‍💋‍👩🏿👩‍👩‍👦‍👦👨‍👩‍👦‍👦🏳️‍🌈👧🏻🤵🏻

  • It doesn't work for non-English terms like the Windows emoji picker (Looking for chaise won't work even if you're in French locale)

  • It doesn't do fuzzy matching or word conjugation like many modern smart emoji pickers or IMEs

  • Some characters might just look as junks because there's no available font for them, but copying them then paste elsewhere still works perfectly


You can also print all characters like this

function Select-AllUniChar([string]$pattern) {
    (Select-String $pattern .\UnicodeData.txt | ForEach-Object {
        $codepoint = [uint32]"0x$($_.Line.Substring(0, $_.Line.IndexOf(';')))"
        [char]::ConvertFromUtf32($codepoint)
    } ) -join ', '
}

Demo:

D:\> Select-AllUniChar "gamma"
Ɣ, ɣ, ɤ, ˠ, Ͷ, ͷ, Γ, γ, Ϝ, ϝ, ᴦ, ᵞ, ᵧ, ℽ, ℾ, Ⲅ, ⲅ, 𝚪, 𝛄, 𝛤, 𝛾, 𝜞, 𝜸, 𝝘, 𝝲, 𝞒, 𝞬, 𝟊, 𝟋

Here's a "simpler" version that doesn't require you to download the Unicode character data but it only works for the BMP

$GetUNameDef = @'
[DllImport("C:/Windows/system32/getuname.dll")]
public static extern int GetUName(
    UInt16 wCharCode,
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder lpbuf);
'@
$un = Add-Type -MemberDefinition $GetUNameDef -Name "GetName" `
    -PassThru -Namespace Runtime.InteropServices
$name = [Text.StringBuilder]::new(1024)

class CharInfo {
    [char]$Character
    [string]$Designation 
    [string]$Name
}

function Select-Char([string]$pattern) {
    1..0xFFFF | ForEach-Object { if ($un::GetUName($_, $name) -gt 0) {
        $charName = $name.ToString()
        if ($charName -like "*$pattern*") {
            [CharInfo]@{
                Character = $_
                Designation = "U+{0:X4}" -f $_
                Name = $charName
            }
        }
    } }
}
4
  • How do I even change a directory in Powershell? I tried cd /d B:\Projects\UnicodeApp but it fails. Commented Jun 19, 2023 at 15:14
  • Also, explorer (Get-ChildItem $PROFILE).Directory fails with an error message [...] Microsoft.PowerShell_profile.ps1' because it does not exist. Commented Jun 19, 2023 at 15:15
  • just cd B:\Projects\UnicodeApp. And probably your powershell profile has been broken. Try fixing that with sfc /scannow. But it's better to install PowerShell Core instead of using the built-in PowerShell which is much older
    – phuclv
    Commented Jun 20, 2023 at 0:05
  • ah I get why, it's because you don't have a profile. Just run New-Item -Path $profile -ItemType "file" -Force to create one. In some cases you can try notepad $PROFILE and save an empty file
    – phuclv
    Commented Jun 20, 2023 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.