If you need to work with all characters include the ones outside the BMP (i.e. code points above U+FFFF), or you want the latest Unicode version then skip this and check the more complete version below in the next section
Otherwise the below PowerShell script can be used which doesn't need any external resources because it uses the available getuname.dll
in System32
$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)
function Select-Char([string]$pattern) {
1..0xFFFF | ForEach-Object { if ($un::GetUName($_, $name) -gt 0) {
$charName = $name.ToString()
if ($charName -like "*$pattern*") {
[PsCustomObject]@{
Character = [char]$_
Designation = "U+{0:X4}" -f $_
Name = $charName
}
}
} }
}
After that you can call Select-Char "pattern"
and copy the desired character
Example output:
PS D:\> Select-Char "dash" | Select-Object -First 4
Character Designation Name
--------- ----------- ----
‒ U+2012 Figure Dash
– U+2013 En Dash
— U+2014 Em Dash
⁓ U+2053 Swung Dash
PS D:\> Select-Char "alpha" | select -First 6
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
You can also pipe the output to Out-GridView to get a filterable GUI, for example Select-Char 'arrow' | Out-GridView
. Sample output:
I don't know which Unicode version getuname.dll
uses though. Also note that there are many limitations of this:
- The output isn't sorted by usage frequency (which requires a much more complex solution that may need to run as a service)
- 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
If you need a more complete solution then first you need to download the latest official Unicode database UnicodeData.txt
. After that you can use the following PowerShell function
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"
Ɣ, ɣ, ɤ, ˠ, Ͷ, ͷ, Γ, γ, Ϝ, ϝ, ᴦ, ᵞ, ᵧ, ℽ, ℾ, Ⲅ, ⲅ, 𝚪, 𝛄, 𝛤, 𝛾, 𝜞, 𝜸, 𝝘, 𝝲, 𝞒, 𝞬, 𝟊, 𝟋
This works for all Unicode characters but it still has the same limitations listed above, and it still won't work for many characters that are combined from multiple code points like these
🏃🏻♀️🐱😶 🇻🇳🇺🇸🇬🇧🇯🇵🇩🇪🇫🇷🇪🇺🇺🇳⚑🏴☠️⚧🏳️⚧️🏩💓👨❤️👨👩🏼❤️👨🏽👩🏻❤️💋👩🏿👩👩👦👦👨👩👦👦🏳️🌈👧🏻🤵🏻
Most of them are emojis and the script can be modified to look also in the emoji database from the Unicode Consortium. But some are really proprietary emojis from some vendors so they aren't available on all platforms and obviously not on the official Unicode database
You can also change the script to print more information
function Select-UniChar([string]$pattern) {
$textInfo = [cultureinfo]::GetCultureInfo('en-US').TextInfo
Select-String $pattern .\UnicodeData.txt | ForEach-Object {
$pos1 = $_.Line.IndexOf(';')
$codepoint = [uint32]"0x$($_.Line.Substring(0, $pos1))"
$pos2 = $_.Line.IndexOf(';', $pos1 + 1)
$name = $_.Line.Substring($pos1 + 1, $pos2 - $pos1 - 1).ToLower()
[PsCustomObject]@{
Character = [char]::ConvertFromUtf32($codepoint)
Designation = "U+" + $codepoint
Name = $textInfo.ToTitleCase($name)
}
}
}
Sample output:
PS D:\> Select-UniChar "cross.*mark|check" | Select-Object -First 8
Character Designation Name
--------- ----------- ----
⍻ U+9083 Not Check Mark
⑇ U+9287 Ocr Amount Of Check
☑ U+9745 Ballot Box With Check
✅ U+9989 White Heavy Check Mark
✓ U+10003 Check Mark
✔ U+10004 Heavy Check Mark
❌ U+10060 Cross Mark
❎ U+10062 Negative Squared Cross Mark