feat: add CP857 (Turkish DOS) to supported document encodings#307782
feat: add CP857 (Turkish DOS) to supported document encodings#307782Diode11-Alt wants to merge 1 commit intomicrosoft:mainfrom
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.
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
|
@jerrysm97 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
@jerrysm97 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
I agree |
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