1XML2TLK(1)                BSD General Commands Manual               XML2TLK(1)
2

NAME

4     xml2tlk — XML to BioWare TLK converter
5

SYNOPSIS

7     xml2tlk [options] [input_file] output_file
8

DESCRIPTION

10     xml2tlk converts XML files created by the tlk2xml(1) tool back into the
11     BioWare TLK format.  For a more in-depth description of TLK files, please
12     see the man page for the tlk2xml(1) tool.  Also note that currently, only
13     the non-GFF versions, V3.0 and V4.0, can be created by xml2tlk.
14
15     The format of the input XML is pretty simple and straight-forward.
16
17     <?xml version="1.0" encoding="utf-8" standalone="yes"?>
18     <tlk language="0">
19       <string id="1">Continue</string>
20       <string id="2" sound="hello">Well hello there!</string>
21       <string id="3" sound="bye" soundlength="0.5">Bye!</string>
22       <string id="4" soundid="23">Who are you?</string>
23     </tlk>
24
25     The root element is “tlk”, and it can have an optional language property.
26     That language ID can also be given on the command line, and it then over‐
27     rides the one in the input XML.  When creating a, versions V3.0 and V4.0
28     need a language ID, while versions V0.2 and V0.5 ignore the language ID.
29
30     Each child tag of the root element has to be a “string” element, and each
31     “string” element requires an “id” property.  The ID is the string refer‐
32     ence (StrRef) for the text line, and the contents of the “string” element
33     is the text itself.  The whole file has to be UTF-8 encoded.
34
35     Version V3.0 allows the following extra properties on a “string”: “sound”
36     (a resource reference of a voice-over for this line, ≤ 16 characters),
37     “soundlength” (a floating point number denoting the length of the sound
38     file in seconds), “volumevariance” (unused by the games) and
39     “pitchvariance” (unused by the games).
40
41     Version V4.0 allows the extra property “soundid” on a “string”, which is
42     a numerical references to a voice-over line.
43
44     Versions V0.2 and V0.5 do not allow any extra properties.
45
46     Because TLK files contain localized string data, it is important to know
47     the encoding of those strings.  Unfortunately, the TLK files do not con‐
48     tain information about the encoding.  Version 3.0 and 4.0 contain a lan‐
49     guage identifier, but the meaning of that varies between games.  V0.2 and
50     V0.5 even lack those completely.  However, due to the Huffman-nature of
51     V0.5 strings, the encoding there is fixed to little-endian UTF-16, and
52     strings in V0.2 files are also usually in little-endian UTF-16 (with the
53     exceptions of files found in the Nintendo DS game Sonic Chronicles: The
54     Dark Brotherhood).  To manually select the encoding, this tool provides a
55     wide range command line options for various encodings.
56
57     Alternatively, the game this TLK is from can be specified and xml2tlk
58     will write the strings in an appropriate encoding for that game and the
59     language ID.  Please note that this does not work for the game Sonic
60     Chronicles: The Dark Brotherhood, since its TLK files do not provide a
61     language ID.
62

OPTIONS

64     -h
65     --help
66           Show a help text and exit.
67     --version
68           Show version information and exit.
69     -3
70     --version30
71           Write a V3.0 TLK file.
72     -4
73     --version40
74           Write a V4.0 TLK file.
75     -l id
76     --language id
77           Override the TLK language ID.
78     --cp1250
79           Write strings as Windows CP-1250.
80
81           Eastern European, Latin alphabet.
82     --cp1251
83           Write strings as Windows CP-1251.
84
85           Eastern European, Cyrillic alphabet.
86     --cp1252
87           Write strings as Windows CP-1252.
88
89           Western European, Latin alphabet.
90     --cp932
91           Write strings as Windows CP-932.
92
93           Japanese, extended Shift-JIS.
94     --cp936
95           Write strings as Windows CP-936.
96
97           Simplified Chinese, extended GB2312 with GBK codepoints.
98     --cp949
99           Write strings as Windows CP-949.
100
101           Korean, similar to EUC-KR.
102     --cp950
103           Write strings as Windows CP-950.
104
105           Traditional Chinese, similar to Big5.
106     --utf8
107           Write strings as UTF-8.
108     --utf16le
109           Write strings as little-endian UTF-16.
110     --utf16be
111           Write strings as big-endian UTF-16.
112     --nwn
113           Write strings in an encoding appropriate for Neverwinter Nights.
114     --nwn2
115           Write strings in an encoding appropriate for Neverwinter Nights 2.
116     --kotor
117           Write strings in an encoding appropriate for Knights of the Old
118           Republic.
119     --kotor2
120           Write strings in an encoding appropriate for Knights of the Old
121           Republic II.
122     --jade
123           Write strings in an encoding appropriate for Jade Empire.
124     --witcher
125           Write strings in an encoding appropriate for The Witcher.
126     --dragonage
127           Write strings in an encoding appropriate for Dragon Age: Origins.
128     --dragonage2
129           Write strings in an encoding appropriate for Dragon Age II.
130     input_file
131           The XML file to convert.  If no input file is specified, the XML
132           data is read from stdin.  The encoding of the XML stream must
133           always be UTF-8.
134     output_file
135           The TLK file will be written there.
136

EXAMPLES

138     Convert file1.xml into a V3.0 CP-1252 TLK file:
139
140           $ xml2tlk --version30 --cp1252 file1.xml file2.tlk
141
142     Convert file1.xml into a V4.0 UTF-8 TLK file and override the language
143     ID:
144
145           $ xml2tlk --version40 --utf8 --language 1 file1.xml file2.tlk
146
147     Convert file1.xml into a V3.0 TLK file from Neverwinter Nights:
148
149           $ xml2tlk --version30 --nwn file1.xml file2.tlk
150
151     Convert the UTF-8 TLK file1.tlk into an XML file on stdout with
152     tlk2xml(1), modify it using sed(1) and write the result back into a TLK:
153
154           $ tlk2xml --utf8 file1.tlk | sed -e 's/gold/candy/g' | xml2tlk \
155             --utf8 --version30 file2.tlk
156

SEE ALSO

158     tlk2xml(1)
159
160     More information about the xoreos project can be found on its website:
161     https://xoreos.org/.
162

AUTHORS

164     This program is part of the xoreos-tools package, which in turn is part
165     of the xoreos project, and was written by the xoreos team.  Please see
166     the AUTHORS file for details.
167
168BSD                              July 23, 2015                             BSD
Impressum