Windows Terminal can not display Chinese text correctly with ls -alh git-bash command #13055

Closed
opened 2026-01-31 03:32:22 +00:00 by claunia · 6 comments
Owner

Originally created by @Holinc19 on GitHub (Mar 16, 2021).

Windows OS : 1909 (18363.1440)
PowerShell Version : 7.1.3
Windows Terminal Version : 1.0.1811.0
image

Originally created by @Holinc19 on GitHub (Mar 16, 2021). Windows OS : 1909 (18363.1440) PowerShell Version : 7.1.3 Windows Terminal Version : 1.0.1811.0 ![image](https://user-images.githubusercontent.com/28728567/111251440-3633d300-864a-11eb-9e32-4de634d15b9e.png)
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 03:32:23 +00:00
Author
Owner

@DHowett commented on GitHub (Mar 16, 2021):

What is the output of locale

@DHowett commented on GitHub (Mar 16, 2021): What is the output of `locale`
Author
Owner

@Holinc19 commented on GitHub (Mar 16, 2021):

What is the output of locale

PS C:\Windows\System32> locale
LANG=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

@Holinc19 commented on GitHub (Mar 16, 2021): > What is the output of `locale` PS C:\Windows\System32> locale LANG= LC_CTYPE="C.UTF-8" LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_ALL=
Author
Owner

@DHowett commented on GitHub (Mar 16, 2021):

PS C:\Windows\System32> this is not "git bash"

@DHowett commented on GitHub (Mar 16, 2021): `PS C:\Windows\System32>` this is not "git bash"
Author
Owner

@Holinc19 commented on GitHub (Mar 16, 2021):

PS C:\Windows\System32> this is not "git bash"

Holinc@DESKTOP-VQU2DOI MINGW64 ~
$ locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8

@Holinc19 commented on GitHub (Mar 16, 2021): > `PS C:\Windows\System32>` this is not "git bash" Holinc@DESKTOP-VQU2DOI MINGW64 ~ $ locale LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_ALL=zh_CN.UTF-8
Author
Owner

@DHowett commented on GitHub (Mar 16, 2021):

I see. You are not in the proper git bash environment. ls is not intended to run outside of git bash.

When run outside of git bash, ls is not properly configured to display Chinese text.

You must run it inside git bash, or set the environment properly (set the environment variable LANG=zh_CN.UTF-8) 😄

@DHowett commented on GitHub (Mar 16, 2021): I see. You are not in the proper git bash environment. `ls` is not intended to run outside of `git bash`. When run outside of `git bash`, ls is not properly configured to display Chinese text. You must run it inside `git bash`, or set the environment properly (set the environment variable LANG=zh_CN.UTF-8) :smile:
Author
Owner

@Holinc19 commented on GitHub (Mar 16, 2021):

I see. You are not in the proper git bash environment. ls is not intended to run outside of git bash.

When run outside of git bash, ls is not properly configured to display Chinese text.

You must run it inside git bash, or set the environment properly (set the environment variable LANG=zh_CN.UTF-8) 😄

ok. It displays correctly while I set $env:LANG='zh_CN.UTF-8' in Microsoft.PowerShell_profile.ps1 file which path is C:\Users\Holinc\Documents\PowerShell

@Holinc19 commented on GitHub (Mar 16, 2021): > I see. You are not in the proper git bash environment. `ls` is not intended to run outside of `git bash`. > > When run outside of `git bash`, ls is not properly configured to display Chinese text. > > You must run it inside `git bash`, or set the environment properly (set the environment variable LANG=zh_CN.UTF-8) 😄 ok. It displays correctly while I set $env:LANG='zh_CN.UTF-8' in `Microsoft.PowerShell_profile.ps1` file which path is `C:\Users\Holinc\Documents\PowerShell`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13055