beta version 0.61.3 2012-05-03
Xcode is a command-line utility which converts English text files from one character-encoding scheme to another. It can be used as a filter reading from standard input, or it can read from one or more files specified on the command line. The resulting text is written to standard output; it can be piped or redirected.
Xcode does not support multi-byte code pages such as those for Chinese, Japanese, or Korean. In particular, code pages 932, 936, 949, and 950 are not supported.
/U /UN /UTF8 filename…
|headers: show filenames before text; |
|disable translation of special characters; suboptions include:|
|disables all of the above|
|interpret non-Unicode input text using code page n|
|output 8-bit text using the default Windows code page|
|output 8-bit text using code page n|
|output text as Unicode (UTF-16) — the default output encoding|
|output text as Unicode (UTF-16) with no Byte Order Mark|
|output text as UTF-8|
If standard input (stdin) is redirected, Xcode will read from stdin
before any filenames specified on the command
line. If no filenames are specified, then
Wrap will read from stdin whether it is redirected or not. If
/H is used, each file’s name will be printed before it
is processed. (For standard input,
<stdin> will be
Input text format option: When the input text is not
in Unicode, the
/I:n option tells Xcode
how to interpret character codes greater than 127. The default behavior is to
use the default Windows code page, usually 1525 in the United States;
/I:n allows you to select a different
one. When the input text is in Unicode,
has no effect.
Output text format options:
/A causes output
to be non-Unicode.
/A by itself writes text as 8-bit character codes
using the default Windows code page.
allows you to specify the code page used to encode character values greater than
127. Either way, any characters which can’t be represented using the
default or specified code page will replaced with a question mark.
and its variants cause output to be in Unicode. If neither
/U is specified, the output encoding defaults to UTF-16.
rem Convert an ASCII text file to Unicode:
xcode "Little, Big.txt" > Unicode_out.txt
The following variables specify a Unicode character used to replace a generic ASCII quote character. The value of the variable may be a single character; a decimal value 32 through 65535; or a hexadecimal value 0x20 through 0xFFFF.
|replaces the ASCII double-quote ( " ) at the start of a quotation; the default value is 0x201C ( “ ).|
|replaces the ASCII double-quote ( " ) at the end of a quotation; the default is 0x201D ( ” ).|
|replaces the ASCII apostrophe ( ' ) at the start of a quotation; the default is 0x2018 ( ‘ ).|
|replaces the ASCII apostrophe ( ' ) at the end of a quotation; the default is 0x2019 ( ’ ).|
|replaces the ASCII apostrophe ( ' ) within a word; the default is 0x2019 ( ’ ).|
|replaces the ASCII apostrophe ( ' ) between two vowels; the default is 0x2018 ( ‘ ).|
Note that the variable name
'OKINA begins, ironically enough, with
an apostrophe. To disable ‘okinas,
(or the same value as the apostrophe).
rem Use guillemets for quotations:
set openquote=0xab & set closequote=0xbb
xcode "Little, Big.txt"
|0||All files successfully processed|
|0||Syntax request via |
|1||Any syntax error|
|2||Any error while processing files|
At present, I compress the binary using either UPX (http://upx.sourceforge.net/) or MPRESS (http://www.matcode.com/mpress.htm).
This is beta software. It may very well have issues. Try it at your own risk.
This program is currently licensed only for testing purposes. I may make binaries and source code available under some free license once I consider it ready for use.