mit (@mithzuu) 在 记录一下Windows解决codex中文乱码&Windows安装PowerShell7 中发帖
最近电脑重装了win11系统,忘记了codex还有中文乱码问题,之前使用的方案是修改系统设置,改编码为utf-8。这个方案一直认为不太好,正好这次改成PowerShell7。顺便记录一下,方便下次配置。
安装PowerShell7
winget install --id Microsoft.PowerShell -e
验证:
pwsh -v
设置utf-8编码
打开PowerShell 7,执行:
notepad $PROFILE
如果提示不存在:
New-Item -Type File -Path $PROFILE -Force
notepad $PROFILE
在文件中写入以下内容:
$OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = New-Object Sy...