5

Sometimes I want to type Unicode characters (em-dash, quotes, Greek letters sometimes, superscripts etc). It can be done using character codes, but then one needs to look up / memorize them, which is… tiresome.

Is there a way to enter characters by names in Windows?

Japanese IME has something like this ― e.g. hoshi (Japanese for «star») converts to «☆» ― but for a very limited subset of Unicode.

phuclv
  • 30,396
  • 15
  • 136
  • 260
Grigory M
  • 201

8 Answers8

5

Unicode Input by Name more or less solves the problem.

Grigory M
  • 201
4

You can try uniqoda. It has a search box where you can type the character you are looking for by name. Last updated in January 2022.

Or try All the Unicode can be installed from Microsoft Store. Last updated in 2017

Overview of all available Unicode characters, including Emojis. Convert selected characters to a required format (for developers) or copy characters to the clipboard. Navigate from the overview of all Unicode ranges to the characters. In more than 54,000 characters, find the desired one by entering a search word.

Try BabelMap (Unicode Character Map for Windows). Seems more current and updated with the lastest emojis. Last updated September 2021 (at the time of writing this answer).

BabelMap is a free character map application for Windows that allows you to browse through the entire Unicode character repertoire of nearly 144,000 characters, or search for a particular character by name or by code point. Characters can then be copied to the clipboard for use in any Unicode-aware application.

2

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:

Out-GridView sample output

Since PowerShell 7 you can also use Out-ConsoleGridView to view the list directly in the console instead of in a GUI window

Out-ConsoleGridView 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

phuclv
  • 30,396
  • 15
  • 136
  • 260
1

Is there a way to enter characters by names in Windows but for a very limited subset of Unicode?

Yes, in fact your qualification makes it a perfect candidate for hotstrings.

You can get a copy of AutoHotkey (even the portable version is sufficient) and use it to run a simple script making use of hotstrings that you can create and tailor to your needs. For example:

::hoshi::☆ ; Automatically replace “hoshi” with a star glyph
           ; or
::星::☆    ; Automatically replace the Kanji character for start with a star


; Some more examples
::hōshasei::☢
::egao::☺
::taiyō::☼
::hurumaisu::♿
::wataru::☦
Synetech
  • 69,547
0

The oldest and the simplest solution is to use the Windows utility of Character Map, which is built into Windows since decades ago.

Character Map can search for symbols in a font based on their Unicode names, and will also search the names by partial strings. Once found, characters can be selected and copied to the clipboard. This requires the option of "Advanced view" to be checked.

Below is the search for "beta" in Arial:

enter image description here

harrymc
  • 498,455
0

I can't swear to it, but I think BabelPad might have a feature like this. If you're using Windows and don't mind limiting yourself to this particular editor (I think you wanted a more general solution), this could work for you.

Codebling
  • 784
0

I don't know of any tool that converts character names to characters on Windows but there are some tools that use AltGr or digraphs

See ЮNICODE Keyboard Enhancer

Key mapping

gVim has many Unicode digraphs for editing UTF-8 files

I can imagine extending UnicodeInput to do what you want.

You might be able to use a commercial text expander such as fastfox or Shortcut but use a single character as the expansion instead of a phrase.

-1

There are programs such as http://www.autohotkey.com/ which allow you to configure your own hotkeys. You could, in theory, create a VBS script (and assign a hotkey to it) which pops up a dialog where you type an alias and it will place the correct char code into the clipboard, which you then paste. You could create your own short list and add to it as you look up a new character code.

horatio
  • 3,719