feat: add CP857 (Turkish DOS) to supported document encodings#307782
Closed
Diode11-Alt wants to merge 2 commits into
Closed
feat: add CP857 (Turkish DOS) to supported document encodings#307782Diode11-Alt wants to merge 2 commits into
Diode11-Alt wants to merge 2 commits into
Conversation
Fixes microsoft#300041 CP857 was the most popular encoding used in Turkey until the 2000s and many legacy projects still use it. It was already supported in the terminal encoding list but was missing from the document encoding picker. This adds CP857 as 'Turkish (CP 857)' to the SUPPORTED_ENCODINGS map, grouped with the other Turkish encodings (Windows 1254, ISO 8859-9). The underlying iconv-lite-umd library already supports CP857, so no additional dependency changes are needed.
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
Author
|
I agree |
bpasero
approved these changes
Apr 23, 2026
This was referenced Apr 23, 2026
rzhao271
approved these changes
Apr 23, 2026
Contributor
auto-merge was automatically disabled
April 24, 2026 06:11
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds CP857 (Turkish DOS) to VS Code's supported document encodings, resolving the long-standing request in #300041 (160+ upvotes).
Problem
CP857 (Code Page 857) was the dominant encoding used in Turkey until the 2000s. Many legacy Turkish projects, government databases, and archived files still use this encoding. Currently, VS Code users working with CP857-encoded files cannot select this encoding from the encoding picker, forcing them to use workarounds or external tools.
While CP857 is already recognized in VS Code's terminal encoding detection (
src/vs/base/node/terminalEncoding.ts), it was missing from the document encoding picker (SUPPORTED_ENCODINGS).Changes
src/vs/workbench/services/textfile/common/encoding.ts:cp857entry to theSUPPORTED_ENCODINGSmap'Turkish (CP 857)'(long) /'CP 857'(short)Why this works without further changes
@vscode/iconv-lite-umdalready supports CP857 natively — no dependency updates neededSUPPORTED_ENCODINGStoNodeEncoding()andencodingExists()functions handle CP857 correctly via iconv-lite's normalizationTesting
@vscode/iconv-lite-umdrecognizes'cp857'as a valid encodingBefore / After
Fixes #300041