[FEATURE] Custom character encoding for Write tool in settings.json
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I work with PowerShell frequently and PowerShell 5.1 has a requirement that unicode characters embedded in the programming itself required encoding the file with UTF-8 BOM but Claude's write tool only supports UTF8. Whenever it writes tests for functionality it always wastes needless compute because it writes out to UTF8 with will not work and then has to replace ALL the unicode characters, which is particularly painful when your project supports unicode and depends on it. It breaks characters if it tries to re-encode the file.
Proposed Solution
A write tool encoding setting in settings.json and settings.local.json that allows override the character encoding used by Claudes write tool.
This feature would support devs of different languages but also specific language quirks like PowerShell 5.1s encoding requirements by allowing custom encodings at the project level.
Alternative Solutions
The only workaround is watching the output and trying to re-encode the file after it writes it but before it runs it for testing, or before you attempt to use the file... VS Code and Notepad++ can both do this but its not convenient.
Priority
High - Significant impact on productivity
Feature Category
File operations
Use Case Example
- Scenario is writing a PowerShell 5.1 script or module that uses any unicode characters inside the script. Such as ▶ or any other character.
- Claude writes output with the unicode characters to a script for testing
- The script fails to execute because of the unicode emojis
- With this feature I could override the default encoding to use UTF8 BOM and the scripts would always execute seemlessly by Claude Code or I can rest easy knowing the PowerShell 5.1 module files it has created will fully support unicode without having to look over all the new ps1 files created to reencode them manually
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗