encoding-handler

Handle text encoding across platforms including UTF-8, Windows codepages, and BOM handling.

509 stars

Best use case

encoding-handler is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Handle text encoding across platforms including UTF-8, Windows codepages, and BOM handling.

Teams using encoding-handler should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/encoding-handler/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/cli-mcp-development/skills/encoding-handler/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/encoding-handler/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How encoding-handler Compares

Feature / Agentencoding-handlerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Handle text encoding across platforms including UTF-8, Windows codepages, and BOM handling.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Encoding Handler

Handle text encoding across platforms.

## Capabilities

- Detect file encoding
- Convert between encodings
- Handle BOM markers
- Configure Windows codepage support
- Normalize text encoding
- Handle encoding errors

## Generated Patterns

```typescript
import { Buffer } from 'buffer';
import iconv from 'iconv-lite';

export function detectBOM(buffer: Buffer): string | null {
  if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) return 'utf-8';
  if (buffer[0] === 0xFF && buffer[1] === 0xFE) return 'utf-16le';
  if (buffer[0] === 0xFE && buffer[1] === 0xFF) return 'utf-16be';
  return null;
}

export function stripBOM(content: string): string {
  return content.charCodeAt(0) === 0xFEFF ? content.slice(1) : content;
}

export function decodeBuffer(buffer: Buffer, encoding = 'utf-8'): string {
  const bom = detectBOM(buffer);
  if (bom) {
    return stripBOM(iconv.decode(buffer, bom));
  }
  return iconv.decode(buffer, encoding);
}

export function encodeString(content: string, encoding = 'utf-8', addBOM = false): Buffer {
  const encoded = iconv.encode(content, encoding);
  if (addBOM && encoding.toLowerCase() === 'utf-8') {
    return Buffer.concat([Buffer.from([0xEF, 0xBB, 0xBF]), encoded]);
  }
  return encoded;
}
```

## Target Processes

- cross-platform-cli-compatibility
- cli-output-formatting
- configuration-management-system

Related Skills

jwt-handler

509
from a5c-ai/babysitter

JWT creation, validation, and management for SDK authentication

tei-text-encoding

509
from a5c-ai/babysitter

Encode texts following Text Encoding Initiative standards for digital editions, annotations, and scholarly apparatus

electron-protocol-handler-setup

509
from a5c-ai/babysitter

Register and handle custom URL protocols (deep linking) across platforms for Electron applications

clipboard-handler

509
from a5c-ai/babysitter

Cross-platform clipboard operations for text, images, files, and rich content

trap-handler-generator

509
from a5c-ai/babysitter

Generate trap handlers for cleanup, signal handling, and graceful shutdown in shell scripts.

mutually-exclusive-group-handler

509
from a5c-ai/babysitter

Generate logic for handling mutually exclusive argument groups with clear error messages and validation in CLI applications.

cross-platform-path-handler

509
from a5c-ai/babysitter

Generate cross-platform path handling utilities for Windows, macOS, and Linux compatibility in CLI applications.

process-builder

509
from a5c-ai/babysitter

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.

Workflow & Productivity

babysitter

509
from a5c-ai/babysitter

Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)

yolo

509
from a5c-ai/babysitter

Run Babysitter autonomously with minimal manual interruption.

user-install

509
from a5c-ai/babysitter

Install the user-level Babysitter Codex setup.

team-install

509
from a5c-ai/babysitter

Install the team-pinned Babysitter Codex workspace setup.