utf8-to-cp1252-conversion

Convert AdvPL and TLPP source files from UTF-8 to Windows-1252.

115|54|Updated May 25, 2026
One-click install
npx skills add https://github.com/totvs/engpro-advpl-tlpp-skills --skill utf8-to-cp1252-conversion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: utf8-to-cp1252-conversion
Source: https://github.com/totvs/engpro-advpl-tlpp-skills/tree/main/skills/advpl-tlpp/utf8-to-cp1252-conversion
Command: npx skills add https://github.com/totvs/engpro-advpl-tlpp-skills --skill utf8-to-cp1252-conversion

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill prevents Protheus compilation failures and character corruption by converting AdvPL/TLPP source files from UTF-8 into Windows-1252 (CP1252), which the Protheus compiler requires.

Core Features & Use Cases

  • In-place UTF-8 BOM-aware conversion: Converts files while stripping UTF-8 BOM when present and preserving the original filename and extension.
  • Deterministic script-based workflow: Uses the provided Bash or Windows batch scripts instead of ad-hoc manual conversions that can corrupt files.
  • Prevention of invalid artifacts: Enforces rules such as no .cp1252 extension files, no backups/duplicates, no renames, and post-conversion verification guidance.
  • Batch and recursive processing: Converts multiple .prw/.prg/.tlpp/.prx/.ch/.th files and supports recursive directory scans.
  • Typical use case: After an AI code-generation or migration skill produces new Protheus sources in UTF-8, run this skill to make them compile-ready in CP1252.

Quick Start

Ask the agent to convert your generated Protheus sources to CP1252 by running the provided script on the files you want compiled.

Frequently Asked Questions about utf8-to-cp1252-conversion

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

FAQPage Schema
Why does Protheus compilation fail on UTF-8 source files?

The Protheus compiler requires Windows-1252 (CP1252) encoding, so compiling UTF-8 AdvPL or TLPP source files results in charset mismatch errors and garbled characters.

How do I convert AdvPL files from UTF-8 to CP1252 for Protheus?

Convert AdvPL files from UTF-8 to CP1252 by running the provided Bash or Windows batch scripts, which strip the UTF-8 BOM and process files in-place for Protheus compilation.

Can I batch convert multiple TLPP and PRW files to Windows-1252 recursively?

Yes, the conversion scripts support batch and recursive directory scans to convert multiple .prw, .prg, .tlpp, .prx, .ch, and .th files to Windows-1252 simultaneously.

Does the conversion process create backup files or change file extensions?

No, the conversion process modifies files in-place, strictly forbidding backup artifacts, duplicate files, and filename or extension changes.

How are unmappable characters handled during UTF-8 to CP1252 conversion?

Unmappable characters are handled safely during conversion, and a post-conversion verification step ensures the output files are no longer UTF-8 before Protheus compilation.