Skip to content

how to fix an encoding issue with Chinese characters when piping in a Windows console? #2511

Answered by cesaryuan
cesaryuan asked this question in Q&A
Discussion options

You must be logged in to vote

ripgrep/FAQ.md

Lines 810 to 814 in 0415448

If you continue to have encoding problems, you can also force the encoding
that the console will use for printing to UTF-8 with
`[System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8`. This
will also reset when PowerShell is restarted, so you can add that line
to your profile as well if you want to make the setting permanent.

Tried this. Now works!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2510 on May 09, 2023 14:33.