[英]Updating UTF in VSCode Terminal
There is an error when launching a flutter application in VSCode. 在VSCode中启动Flutter应用程序时出错。 It require the LANG setting to be en_US.UTF-8
它要求LANG设置为en_US.UTF-8
The issue and warning can be found here: https://github.com/NativeScript/NativeScript/issues/3659 可以在这里找到问题和警告: https : //github.com/NativeScript/NativeScript/issues/3659
I've followed the advice I found there and added export LANG=en_US.UTF-8
in my .bash_profile
(mac) which has updated VSCode's UTF as well. 我遵循了在那里找到的建议,并在我的.bash_profile
(mac)中添加了export LANG=en_US.UTF-8
,它也更新了VSCode的UTF。
However, when I re-run, I receive the same warning(s): 但是,当我重新运行时,会收到相同的警告:
WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
Where can I find the ~/.profile
file to update it as well? 在哪里可以找到~/.profile
文件进行更新?
The problem here is likely that where you've set the environment variable doesn't apply to VS Code based on how you ran it. 这里的问题可能是,根据环境变量的设置,您在其中设置环境变量的位置不适用于VS Code。 For example if you set an env variable in .profile
but then launch VS Code from the iOS dock, it might not inherit that value. 例如,如果您在.profile
设置了一个env变量,然后从iOS Dock启动VS Code,则它可能不会继承该值。
To confuse things, when you use the built-in Terminal in VS Code, it will cause your bash startup scripts to run, which meants the built-in terminal makes it seem like the variable is set (but it's actually only set for the terminal, and not for commands that VS Code extensions spawn). 令人困惑的是,当您在VS Code中使用内置终端时,它将导致您的bash启动脚本运行,这意味着内置终端使其看起来像已设置了变量(但实际上仅是为终端设置了) ,不适用于VS Code扩展名产生的命令)。
There are two possible fixes: 有两个可能的修复:
dart.env
in your VS Code user settings: 在VS Code用户设置的dart.env
中进行设置: "dart.env": { "LANG": "en_US.UTF-8" },
This should apply it to any Flutter processes spawned by the Flutter extension and prevent the warning. 这应该将其应用于Flutter扩展产生的任何Flutter进程,并防止出现警告。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.