- Home
- Skills
- Agents & Orchestration
- Repair Unicode & Text Encoding Bugs
More screenshots
Works with the AI Agents you already use
Repair Unicode & Text Encoding Bugs
Repair Unicode & Text Encoding Bugs is a bounded ToolForge Labs workflow.
$1
Repair Unicode & Text Encoding Bugs
Example session with this skill installed
Fix the issue where emojis in our Postgres DB are turning into question marks when fetched by our Node.js API and sent to a legacy CSV exporter. Our DB is UTF-8.
- Read your context and instructions
- Compiled the repair unicode
I have analyzed the data flow from Postgres through the Node.js runtime to your legacy CSV exporter. The issue stems from the CSV export stream defaulting to ascii or latin1 encoding, which cannot represent multi-byte emoji characters, leading to replacement characters (?).
Unicode Repair Strategy
The following patch ensures the Node.js fs.createWriteStream or library equivalent uses the correct encoding and adds a normalization step to prevent drift during the round-trip.
const fs = require('fs');
const { Readable } = require('stream');
// Fix: Explicitly set UTF-8 with BOM for legacy Excel-friendly CSVs
// and ensure NFD normalization if the source data comes from macOS clients
function createLegacyExporter(outputPath) {
// Use UTF-8 with BOM (\ufeff) to force legacy apps (Excel) to recognize encoding
const stream = fs.createWriteStream(outputPath, { encoding: 'utf8' });
stream.write('\ufeff');
return stream;
}
// Deterministic Test Case
function testEmojiPersistence() {
const input = "User_🚀_Report";
const normalized = input.normalize('NFC');
// Verify byte length for UTF-8 (Rocket is 4 bytes)
const buf = Buffer.from(normalized, 'utf8');
if (buf.length !== 15) {
throw new Error(`Encoding mismatch: Expected 15 bytes, got ${buf.length}`);
}
console.log("✓ Unicode invariant check passed: Emojis preserved in buffer.");
}
testEmojiPersistence();
| Component | Current State | Target Invariant | Repair Action |
|---|---|---|---|
| Postgres | UTF-8 | UTF-8 | None required |
| Node.js API | NFD/NFC Mix | NFC (Canonical) | Add .normalize('NFC') on ingress |
| CSV Exporter | Default (Latin1) | UTF-8 + BOM | Explicitly set utf8 and write BOM |
Next steps
- Apply the
.normalize('NFC')call to your database service layer to unify incoming text. - Update the CSV stream configuration to use
utf8instead of the system default. - Run the provided
testEmojiPersistencescript in your CI environment to catch regressions.
Connects securely to your tools. The creator never sees your data.
About this skill
Repair Unicode & Text Encoding Bugs is a bounded ToolForge Labs workflow. Diagnose and repair Unicode decoding/encoding, normalization, byte-to-text boundaries, BOMs, replacement characters, line endings, and cross-service text drift. Works from full repositories or partial context such as snippets, logs, configuration, traces, and architecture notes. Produces concrete repair patterns and focused deterministic tests while preserving existing product/security policy. It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Cannot verify production systems, external services, or facts that are not present in supplied evidence. With partial context it returns bounded diagnosis/review, explicit assumptions, and a deterministic validation plan rather than claiming successful execution.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
Use a clean branch or a controlled review workspace. Supply repository files, logs, traces, configuration, or evidence needed for the task. Review all patches/findings before merge or operational action; keep production credentials and destructive production actions out of the workflow.