microsoft / microsoft/vscode-cpptools
The behavior of VS Code's "files.autoGuessEncoding" setting is not replicated when opening files directly from disk
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
From: https://github.com/microsoft/vscode/issues/87160
Issue Type: Bug
Steps
- Create .h and .cpp files (with different encoding)
- Add comments in Chinese to functions in .h file (encoding: GB2312)
- Use the predefined function in .cpp file (encoding: utf-8)
- Trigger C++ suggestions
Results
- In .h file, the commnet texts were rendered as expected.

- In .cpp file, the comment texts got bad encoding.

Version
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% |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported steps with files encoded as GB2312 and UTF-8, comparing behavior when opened directly from disk with VS Code's files.autoGuessEncoding setting. Trace the extension's handling of directly opened files and encoding detection, then verify that comments from both files render correctly when triggering C++ suggestions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100