第一、在代码工作区修改为UTF-8编码方式
1.1 首先我们点击主界面右下角这个标志,如图所示
1.2 随后控制指令窗口会弹出来,继续点击通过编码重新打开
1.3 点开之后就会出现各种编码格式,我们选择UTF-8即可,当然也可以选择自己需要的格式
2.在终端修改为UTF-8编码方式
2.1 我们首先在左上角找到文件点击打卡,选中其中的首选项,继续点击打开选择里面的设
2.2 第一步在命令行输入code runner,找到其中的Run in Terminal ,这里就是配置终端信息的地方,第二部点击其中的setting.json中编辑(我这里已经配置好了所以没有提示,就是我图中蓝色字体那样,点击打开就行),在文件里面继续修改配置。
setting.json
{ "workbench.startupEditor": "none", "[javascript]": { "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" }, "editor.stickyScroll.enabled": false, "editor.minimap.enabled": false, "[jsonc]": { "editor.defaultFormatter": "vscode.json-language-features" }, "security.workspace.trust.untrustedFiles": "open", "debug.inlineValues": "on", "files.autoGuessEncoding": true, "code-runner.runInTerminal": true, "code-runner.saveAllFilesBeforeRun": true, "code-runner.saveFileBeforeRun": true, "code-runner.languageIdToFileExtensionMap": { "bat": ".bat", "powershell": ".ps1", "typescript": ".ts" }, "code-runner.executorMap": { "javascript": "node", "java": "chcp 65001 && cd $dir && javac $fileName && java $fileNameWithoutExt", "c": "chcp 65001 && cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "zig": "zig run", "cpp": "chcp 65001 && cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "objective-c": "chcp 65001 && cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "php": "php", "python": "python -u", "perl": "perl", "perl6": "perl6", "ruby": "ruby", "go": "go run", "lua": "lua", "groovy": "groovy", "powershell": "powershell -ExecutionPolicy ByPass -File", "bat": "cmd /c", "shellscript": "bash", "fsharp": "fsi", "csharp": "scriptcs", "vbscript": "cscript //Nologo", "typescript": "ts-node", "coffeescript": "coffee", "scala": "scala", "swift": "swift", "julia": "julia", "crystal": "crystal", "ocaml": "ocaml", "r": "Rscript", "applescript": "osascript", "clojure": "lein exec", "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt", "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt", "racket": "racket", "scheme": "csi -script", "ahk": "autohotkey", "autoit": "autoit3", "dart": "dart", "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt", "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt", "haskell": "runghc", "nim": "nim compile --verbosity:0 --hints:off --run", "lisp": "sbcl --script", "kit": "kitc --run", "v": "v run", "sass": "sass --style expanded", "scss": "scss --style expanded", "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css", "FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "sml": "cd $dir && sml $fileName", "mojo": "mojo run", "erlang": "escript", "spwn": "spwn build", "pkl": "cd $dir && pkl eval -f yaml $fileName -o $fileNameWithoutExt.yaml", "gleam": "gleam run -m $fileNameWithoutExt" } }