iconv.md 573 B

cli.iconv

  • Convert file encoding

This module allows you to convert the encoding of text files. It supports various encodings like UTF-8, GBK, UTF-16, etc.

It can be used in configuration files or directly from the command line.

convert

Convert a file from one encoding to another.

import("cli.iconv")

-- Convert file from GBK to UTF-8
iconv.convert("src.txt", "dst.txt", {from = "gbk", to = "utf8"})

We can also use it from the command line:

$ xmake l cli.iconv --from=gbk --to=utf8 src.txt dst.txt