My Windows environment, 2018 edition

I think I’ve found a workable solution for Unicode support from a Windows command line. I’ve made various posts about editing tools in this blog but I hadn’t found one satisfactory. Sinan Ünür and I took another wack at configuring something to handle Unicode (mostly to support my work on Learning Perl 6) and I think we have something that works.

And I need these instructions because I’m not a regular Windows user. These notes are as much for me as they are for you. If you have other suggestions or a different environment that works let me know about it. I tend to stop when I have something that works. Previous posts are the Tools category.

Windows 10

In previous posts I was using Windows 7 or Windows 8. I’m simply not going to worry about them. I’m using Windows 10 and I think many things have been fixed or improved. I’m not motivated to discover which of those might be true.


I tend to work inside PowerShell which I find that it a bit nicer than Command Prompt. However, it’s a bit lacking in some UTF-8 aspects I haven’t been able to figure out. It doesn’t properly interpret the text that comes out of perl (or at least I and Google couldn’t figure it out). I’ll do basic Windows maintenance there such as installing software and so on. I start it as an administrator to do my work and then get out. For basic development I use ConEmu.

The Chocolatey package manager

I use the Chocolatey package manager to get most of what I need. That includes Strawberry Perl and ConEmu. Follow its installation instructions to install that from a PowerShell administrator window:

PS C:\WINDOWS\system32> choco install strawberryperl
PS C:\WINDOWS\system32> choco install ConEmu
PS C:\WINDOWS\system32> refreshenv

You might want an editor. I like NotePad++ but I’m not very picky. It’s available in chocolatey too:

PS C:\WINDOWS\system32> choco install notepadplusplus

Git is in there too:

PS C:\WINDOWS\system32> choco install git
PS C:\WINDOWS\system32> refreshenv

After that you can drop the administrator PowerShell window and open a regular user window. You can do all of this in an administrator window in one of the other console programs I think, but chocolatey is a PowerShell thing so that’s where I start.


To run programs I use ConEmu. It mostly does the right thing with UTF-8 output although. You might need a better font (perhaps Symbola, DejaVu Sans Mono, or Input Medium Condensed).

When you get to a prompt you need to set the code page to 65001 for UTF-8 output. Apparently setting this permanently breaks various things in Windows.

C:\Users\amelia> chcp 65001

I set up two fonts in ConEmu and that seems to work out well for me. For reasons I didn’t investigate and may have accidentally solved things, setting the fallback font to Symbola solved many problems with missing characters.

ConEmu settings

Also see:

Check your programs

After you install Strawberry Perl and refresh the environment try a simple invocation from the command line. You can check the version. You should get something like this:

C:\Users\amelia> perl -v
This is perl 5, version 26, subversion 1 (v5.26.1) built for MSWin32-x64-multi-thread

Copyright 1987-2017, Larry Wall

If you also installed ActivePerl look closely to see that you are getting the one that you expect.

Edit a file

Somehow create and edit a file. If you installed NotePad++ you can run it from the command line:

C:\Users\amelia> notepad++ hello.p1

Put in this simple text:

print "Hello Perl!\n";

Run a file

C:\Users\amelia> perl
Hello Perl!

When that works, try something more complicated that has a bunch of Unicodey things in it:


use utf8;
use open qw(:std :utf8);

print <<'END';
Basic accents and things--------------
Leftward Double Arrow (⇐, 0x21D0)
Rightward Double Arrow (⇒, 0x21D2)
When you want a job you prepare your résumé
Hello Mr Sørensen

Things that matter to Perl 6----------
Corner brackets: 「 」
Fancy double list quotes:  « »
Terms: π τ ∞
Exponents: ⁰ ¹ ⁹

Emoji things -------------------------
Thumbs up: 👎
Butterfly: 🦋

Run that to see if you get what you expect in the console.

If it looks garbled into the console, redirect the output to a file and look there. The program is probably outputting the right thing but the console is not interpreting correctly. Your editor probably displays the file correctly.

You might also check that you aren't accidentally getting an UTF-8 BOM (byte order mark). For some reason some Windows things like to put that at the beginning of your file. Notepad++ has an option to do this although mine was turned off when I installed it.

Once the data in the file are correct you might explore font issues.

Leave a Reply

Your email address will not be published. Required fields are marked *