Skip to content

Commit 4d1185c

Browse files
committed
Explain setting Windows to UTF-8 in README (sapeurfaire++)
1 parent 91bc488 commit 4d1185c

File tree

6 files changed

+62
-4
lines changed

6 files changed

+62
-4
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Revision history for Terminal-Tests
33
{{$NEXT}}
44
[Docs]
55
- Update Windows Terminal screenshots (sapeurfaire++)
6+
- Add README section for setting UTF-8 mode for Windows Terminal (sapeurfaire++)
67

78
[Packaging]
89
- Bump T::C dependency to 0.0.13+ for Windows Terminal autodetection

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,31 @@ Terminal-Specific Recommended Tweaks
134134

135135
By default Windows Terminal under Windows 10/11 supports only UTF-16, an old Unicode encoding that has otherwise been replaced by the UTF-8 encoding. You'll need to change the settings for Windows Terminal to use UTF-8 instead. (Backwards compatibility with ancient software is certainly a thing, but modern terminal-interface software doesn't really speak anything but UTF-8 anymore.)
136136

137-
I used to point to online instructions for this, but unfortunately they have disappeared and the Wayback Machine did not archive them. Please contact me if you have replacement instructions.
137+
Thanks to [sapeurfaire](https://github.com/sapeurfaire)++, we now have instructions to change this setting either temporarily or permanently.
138+
139+
If you would like to change to UTF-8 **just for PowerShell**, you can simply tell it to use Code Page 65001 (Microsoft naming for UTF-8) -- either when running it manually or as part of the command that Windows Terminal launches for your PowerShell profile -- by adding the following options to the PowerShell command line:
140+
141+
`-NoExit -Command "chcp 65001"`
142+
143+
If you'd like to switch to UTF-8 for **ALL** terminal applications, you can follow this path in the system settings:
144+
145+
Settings --> Time & language --> Language & region --> Administrative language settings --> Change system locale
146+
147+
You should see this window:
148+
149+
![Screenshot of Windows Region Settings dialog](docs/images/Windows-Region-Settings-Beta-UTF-8.png)
150+
151+
Select the "Beta: Use Unicode UTF-8 for worldwide language support" checkbox. You will then need to restart your computer so the change can take effect:
152+
153+
![Screenshot of Change System Locale restart dialog](docs/images/Windows-Region-Settings-Restart-Needed.png)
154+
155+
If you prefer to make such changes via script rather than dialog boxes, you can use this PowerShell script to elevate privileges and edit the registry for you:
156+
157+
[PowerShell UTF-8 registry editing script](https://gist.github.com/sapeurfaire/8e0a9518a89f0bde064c4d49afd09f5f)
158+
159+
For best Unicode and emoji handling, you will also want to set the Windows Terminal Compatibility setting for Text measurement mode to "Grapheme clusters":
160+
161+
![Screenshot of Windows Terminal Compatibility settings dialog](docs/images/Windows-Terminal-Settings-Grapheme-clusters.png)
138162

139163
### Ghostty 1.2.x
140164

70.3 KB
Loading
34.6 KB
Loading
90.5 KB
Loading

lib/Terminal/Tests.rakumod

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,42 @@ You'll need to change the settings for Windows Terminal to use UTF-8 instead.
220220
(Backwards compatibility with ancient software is certainly a thing, but modern
221221
terminal-interface software doesn't really speak anything but UTF-8 anymore.)
222222
223-
I used to point to online instructions for this, but unfortunately they have
224-
disappeared and the Wayback Machine did not archive them. Please contact me
225-
if you have replacement instructions.
223+
Thanks to L<sapeurfaire|https://github.com/sapeurfaire>++, we now have
224+
instructions to change this setting either temporarily or permanently.
225+
226+
If you would like to change to UTF-8 B<just for PowerShell>, you can simply
227+
tell it to use Code Page 65001 (Microsoft naming for UTF-8) -- either when
228+
running it manually or as part of the command that Windows Terminal launches
229+
for your PowerShell profile -- by adding the following options to the
230+
PowerShell command line:
231+
232+
C<-NoExit -Command "chcp 65001">
233+
234+
If you'd like to switch to UTF-8 for B<ALL> terminal applications, you can follow
235+
this path in the system settings:
236+
237+
Settings --> Time & language --> Language & region --> Administrative language settings --> Change system locale
238+
239+
You should see this window:
240+
241+
L<Screenshot of Windows Region Settings dialog|docs/images/Windows-Region-Settings-Beta-UTF-8.png>
242+
243+
Select the "Beta: Use Unicode UTF-8 for worldwide language support" checkbox.
244+
You will then need to restart your computer so the change can take effect:
245+
246+
L<Screenshot of Change System Locale restart dialog|docs/images/Windows-Region-Settings-Restart-Needed.png>
247+
248+
If you prefer to make such changes via script rather than dialog boxes, you
249+
can use this PowerShell script to elevate privileges and edit the registry
250+
for you:
251+
252+
L<PowerShell UTF-8 registry editing script|https://gist.github.com/sapeurfaire/8e0a9518a89f0bde064c4d49afd09f5f>
253+
254+
For best Unicode and emoji handling, you will also want to set the Windows
255+
Terminal Compatibility setting for Text measurement mode to "Grapheme clusters":
256+
257+
L<Screenshot of Windows Terminal Compatibility settings dialog|docs/images/Windows-Terminal-Settings-Grapheme-clusters.png>
258+
226259
227260
=head3 Ghostty 1.2.x
228261

0 commit comments

Comments
 (0)