Menu

AidaHelp_9 Log in to Edit

Bernard Desgraupes

Top | Prev | Next

<A name="MARKSEC31"></A>

Input and output encodings

The input encoding is the encoding in which the Aida file is written. The
output encoding is the encoding in which the aida convert and the
aida split commands write their output.

In order to know the names of the available encodings, one can execute the
following instruction:

    aida info encodings

The list of available encodings depends on your Tcl installation. Here is
what a standard distribution usually provides:

    ascii        cp1255          iso8859-13
    big5         cp1256          iso8859-14
    cp437        cp1257          iso8859-15
    cp737        cp1258          iso8859-16
    cp775        dingbats        jis0201
    cp850        ebcdic          jis0208
    cp852        euc-cn          jis0212
    cp855        euc-jp          koi8-r
    cp857        euc-kr          koi8-u
    cp860        gb12345         ksc5601
    cp861        gb1988          macCentEuro
    cp862        gb2312          macCroatian
    cp863        gb2312-raw      macCyrillic
    cp864        identity        macDingbats
    cp865        iso2022         macGreek
    cp866        iso2022-jp      macIceland
    cp869        iso2022-kr      macJapan
    cp874        iso8859-1       macRoman
    cp932        iso8859-2       macRomania
    cp936        iso8859-3       macThai
    cp949        iso8859-4       macTurkish
    cp950        iso8859-5       macUkraine
    cp1250       iso8859-6       shiftjis
    cp1251       iso8859-7       symbol
    cp1252       iso8859-8       tis-620
    cp1253       iso8859-9       unicode
    cp1254       iso8859-10      utf-8

The UTF8 Unicode encoding form can be designated as utf-8 or
utf8. The UTF16 encoding form can be designated as unicode,
utf-16 or utf16.

These encodings are specified via the command line options -from
and -to or using environment variables as explained below.

<A name="MARKSEC32"></A>

Default encodings

Aida has default values for the input and output encodings. These defaults
can be obtained with the command aida info like this
respectively:

    aida info from
    aida info to

The default encodings are used when the options -from or -to
are not specified on the command line.

<A name="MARKSEC33"></A>

Setting encodings programmatically

The aida::inputEncoding and aida::outputEncoding commands
are Tcl commands defined by Aida and understood by its Tcl interpreter.
They allow to get or set the current encodings. See the section
Aida core Tcl commands for more information about
how these commands work.

These commands can be used in a configuration file in order to
establish default values for the encodings. Not that once the aida
command started parsing the input file, it is not possible to change the
encodings anymore. This means, in particular, that these commands have no
effect if they are used in a header parameter because when the parser reads
the header instructions, it is already too late to change the encodings.

If no default value has been declared, Aida uses the default encoding for
the system as returned by the Tcl command [encoding system].

<A name="MARKSEC34"></A>

Encoding environment variables

Aida supports two environment variables, named AIDA_INPUT_ENCODING and
AIDA_OUTPUT_ENCODING, which provide another mean of setting the input and
the output default encodings.

For instance, in the case of the bash shell, one can invoke the aida
command like this:

    export AIDA_INPUT_ENCODING=cp1252
    export AIDA_OUTPUT_ENCODING=macRoman
    aida convert somefile.aida

or

    AIDA_INPUT_ENCODING=iso8859-1 aida convert somefile.aida

Related

Wiki: AidaHelp_10

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.