bat-encoding-standards

Enforce UTF-8 encoding and chcp 65001 in Windows batch files.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/drgon1/santian --skill bat-encoding-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bat-encoding-standards
Source: https://github.com/drgon1/santian/tree/main/ai-skills/skills/bat-encoding-standards
Command: npx skills add https://github.com/drgon1/santian --skill bat-encoding-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents Windows batch files from breaking because of encoding mismatches, line-ending corruption, and inconsistent behavior between IDE testing and real double-click execution.

Core Features & Use Cases

  • Encoding-safe BAT authoring: Keeps batch files in UTF-8, applies the required startup code page switch, and avoids common corruption patterns during edits.
  • Child-script and Python interoperability: Enforces the rules for nested batch files and Python scripts so parameters, output, and character handling remain reliable.
  • Real-world validation: Useful when creating or fixing launchers, installers, maintenance scripts, or any .bat workflow that must work correctly in a user’s local CMD window.

Quick Start

Ask the AI to review or generate your batch script with this Skill before making any .bat changes so it can apply the encoding and validation rules first.

Frequently Asked Questions about bat-encoding-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Windows batch file break when double-clicked but work in the IDE?

Windows batch files often break when double-clicked due to encoding mismatches and line-ending corruption between the IDE and CMD. Applying UTF-8 file handling and a first-entry chcp 65001 step ensures consistent execution behavior across environments.

How do I prevent UTF-8 encoding bugs in nested batch scripts?

To prevent UTF-8 encoding bugs in nested batch scripts, keep files in UTF-8 and apply the code page switch only in the parent script. Avoid repeating chcp 65001 in child scripts to maintain reliable parameter passing and character handling.

Do I need chcp 65001 in every child batch file?

No, you do not need chcp 65001 in every child batch file. You should include the chcp 65001 step as a first-entry command in the parent script only, preventing code page conflicts during nested batch calls.

How to fix batch script encoding issues when calling Python?

Fix batch script encoding issues when calling Python by enforcing UTF-8 file handling for both scripts. Require UTF-8 declarations for Python files and ensure the parent batch file executes chcp 65001 before invoking the Python script.

What is the best way to validate a batch file before shipping?

The best way to validate a batch file before shipping is independent CMD window testing. Run the script outside the IDE to simulate real user double-click execution and confirm encoding and line-ending integrity.

Can I use this to fix existing batch launchers and installers?

Yes, you can use this to fix existing batch launchers and installers. It validates and corrects encoding mismatches and line-ending corruption to ensure maintenance scripts work correctly in a user's local CMD window.