1TLK2XML(1) BSD General Commands Manual TLK2XML(1)
2
4 tlk2xml — BioWare TLK to XML converter
5
7 tlk2xml [options] input_file [output_file]
8
10 tlk2xml converts BioWare's TLK files into human-readable XML. TLK are
11 “talk tables”, a list of strings indexed by an ID, used for all user-vis‐
12 ible text in a BioWare game. All strings for a campaign or module are
13 usually collected in one file for each supported language, and languages
14 with sentences that vary wildly depending on whether the player character
15 is male or female use a second TLK with strings for the female version.
16
17 There's two distinct TLK formats. One is a whole separate file format
18 (which uses version IDs V3.0 and V4.0), the other is a GFF (and uses ver‐
19 sion IDs V0.2 and V0.5). Within those two major versions, the differ‐
20 ences are smaller: V4.0 removed fields for each string not needed any‐
21 more, and V0.5 compresses strings using a Huffman tree. This tool can
22 read all of these variants and produces a human-read XML file.
23
24 Because these files contain localized string data, it is important to
25 know the encoding of those strings. Unfortunately, the TLK files do not
26 contain information about the encoding. Version 3.0 and 4.0 contain a
27 language identifier, but the meaning of that varies between games. V0.2
28 and V0.5 even lack those completely. However, due to the Huffman-nature
29 of V0.5 strings, the encoding there is fixed to little-endian UTF-16, and
30 strings in V0.2 files are also usually in little-endian UTF-16 (with the
31 exceptions of files found in the Nintendo DS game Sonic Chronicles: The
32 Dark Brotherhood). To manually select the encoding, this tool provides a
33 wide range command line options for various encodings.
34
35 Alternatively, the game this TLK is from can be specified and tlk2xml
36 will read the strings in an appropriate encoding for that game and the
37 language ID found in the TLK. Please note that this does not work for
38 the game Sonic Chronicles: The Dark Brotherhood, since its TLK files do
39 not provide a language ID.
40
42 -h
43 --help
44 Show a help text and exit.
45 --version
46 Show version information and exit.
47 --cp1250
48 Read strings as Windows CP-1250. Eastern European, Latin alphabet.
49 --cp1251
50 Read strings as Windows CP-1251. Eastern European, Cyrillic alpha‐
51 bet.
52 --cp1252
53 Read strings as Windows CP-1252. Western European, Latin alphabet.
54 --cp932
55 Read strings as Windows CP-932. Japanese, extended Shift-JIS.
56 --cp936
57 Read strings as Windows CP-936. Simplified Chinese, extended
58 GB2312 with GBK codepoints.
59 --cp949
60 Read strings as Windows CP-949. Korean, similar to EUC-KR.
61 --cp950
62 Read strings as Windows CP-950. Traditional Chinese, similar to
63 Big5.
64 --utf8
65 Read strings as UTF-8.
66 --utf16le
67 Read strings as little-endian UTF-16.
68 --utf16be
69 Read strings as big-endian UTF-16.
70 --nwn
71 Read strings in an encoding appropriate for Neverwinter Nights.
72 --nwn2
73 Read strings in an encoding appropriate for Neverwinter Nights 2.
74 --kotor
75 Read strings in an encoding appropriate for Knights of the Old
76 Republic.
77 --kotor2
78 Read strings in an encoding appropriate for Knights of the Old
79 Republic II.
80 --jade
81 Read strings in an encoding appropriate for Jade Empire.
82 --witcher
83 Read strings in an encoding appropriate for The Witcher.
84 --dragonage
85 Read strings in an encoding appropriate for Dragon Age: Origins.
86 --dragonage2
87 Read strings in an encoding appropriate for Dragon Age II.
88 input_file
89 The TLK file to convert.
90 output_file
91 The XML file will be written there. If no output file is specified,
92 the XML data is written to stdout. The encoding of the XML stream is
93 always UTF-8.
94
96 Convert the CP-1252 TLK file1.tlk into an XML file:
97
98 $ tlk2xml --cp1252 file1.tlk file2.xml
99
100 Convert the UTF-16LE TLK file1.tlk into an XML file on stdout:
101
102 $ tlk2xml --utf16le file1.tlk
103
104 Convert the TLK file1.tlk from Neverwinter Nights into an XML file:
105
106 $ tlk2xml --nwn file1.tlk file2.xml
107
108 Convert the UTF-8 TLK file1.tlk into an XML file on stdout, modify it
109 using sed(1) and use xml2tlk(1) to write it back into a TLK:
110
111 $ tlk2xml --utf8 file1.tlk | sed -e 's/gold/candy/g' | xml2tlk \
112 --utf8 --version30 file2.tlk
113
115 gff2xml(1), ssf2xml(1), xml2tlk(1)
116
117 More information about the xoreos project can be found on its website:
118 https://xoreos.org/.
119
121 This program is part of the xoreos-tools package, which in turn is part
122 of the xoreos project, and was written by the xoreos team. Please see
123 the AUTHORS file for details.
124
125BSD April 15, 2016 BSD