From: https://github.com/microsoft/vscode/issues/87160
Issue Type: Bug


VS Code version: Code 1.41.0 (9579eda04fdb3a9bba2750f15193e5fafe16b959, 2019-12-11T18:37:42.077Z)
OS version: Windows_NT x64 10.0.18362
Remote OS version: Linux x64 3.10.107-1-tlinux2_kvm_guest-0049
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|15.89GB (9.43GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
|Item|Value|
|---|---|
|Remote|SSH: docker|
|OS|Linux x64 3.10.107-1-tlinux2_kvm_guest-0049|
|CPUs|Intel(R) Xeon(R) CPU E5-26xx v4 (8 x 3199)|
|Memory (System)|15.42GB (1.76GB free)|
|VM|0%|
We only support UTF-8 currently. We're tracking adding support for other encodings with https://github.com/microsoft/vscode-cpptools/issues/414 .
Closing duplicate issue.
@BOT-Man-JL Should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders4 . Let us know if you see any remaining bugs with non-UTF-8 encodings.
@BOT-Man-JL Should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders4 . Let us know if you see any remaining bugs with non-UTF-8 encodings.
@sean-mcmanus It still has this problem...


Hi @BOT-Man-JL . It's not mentioned here, but have you set VS Code's files.encoding setting to GB2312? The C/C++ Extension does not replicate VS Code's files.autoGuessEncoding behavior when opening files directly from disk, but should now use files.encoding when opening files from disk (if the file does not have a BOM, and is not UTF16 LE/BE). If you are setting files.encoding and not getting the proper text, that may be a bug in 0.30.0-insiders4. If you are expecting the encoding to be auto-detected without setting files.encoding, this issue should be re-opened and de-duped from https://github.com/microsoft/vscode-cpptools/issues/414 , as that is not currently supported.
Hi @Colengms, my files.encoding was not set.
In my scenario, I suppose that files.autoGuessEncoding is necessary because each document is either UTF-8 or GB2312 (not the same encoding), or maybe other encoding.