# man > enc2xs(1)

---
type: CommandReference
command: enc2xs
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `enc2xs -M ModName mapfiles...` — generate Encode extension from .ucm or .enc files
- `enc2xs -C` — update `Encode::ConfigLocal` for demand-loaded encodings
- `perl Makefile.PL` — create Makefile from generated `Makefile.PL`
- `make` — build and compile the encoding tables
- `make test` — run test suite
- `make install` — install the module
- `mkdir Encode; mv *.ucm Encode; enc2xs -M My Encode/*ucm` — install .ucm files with modules
- `ucmlint` / `ucmsort` — utilities to check/sort UCM files (in `Encode/bin`)

## Name

`enc2xs` -- Perl Encode Module Generator

## Synopsis

shell
enc2xs -[options]
enc2xs -M ModName mapfiles...
enc2xs -C
## Options

- `-M ModName` — specify the Perl module name (e.g., `My` for `Encode::My`)
- `-C` — update `Encode::ConfigLocal` for demand-loaded encoding support
- `-Q` — quiet mode (used internally during build)
- `-O` — optimize compiled form (duplicate detection, substring savings)
- `-o filename.c` — output C source file name (default `encode_t.c`)
- `-f filename.fnm` — file containing list of input encoding files

## Examples

**Creating a new encoding from a UCM file:**

shell
$ ls -F
my.ucm
$ enc2xs -M My my.ucm
generating Makefile.PL
generating My.pm
generating README
generating Changes
$ perl Makefile.PL
Writing Makefile for Encode::My
$ make
$ make test
$ make install
**Register encoding for demand-loading:**

shell
enc2xs -C
## See Also

- [Encode](http://localhost/phpMan.php/perldoc/Encode/markdown), [perlmod](http://localhost/phpMan.php/perldoc/perlmod/markdown), [perlpod](http://localhost/phpMan.php/perldoc/perlpod/markdown)
- ICU Home Page: <http://www.icu-project.org/>
- ICU Character Mapping Tables: <http://site.icu-project.org/charts/charset>
- ICU Conversion Data: <http://www.icu-project.org/userguide/conversion-data.html>

## Exit Codes

Not documented.