.Dd April 15, 2016 .Dt TLK2XML 1 .Os .Sh NAME .Nm tlk2xml .Nd BioWare TLK to XML converter .Sh SYNOPSIS .Nm tlk2xml .Op Ar options .Ar input_file .Op Ar output_file .Sh DESCRIPTION .Nm converts BioWare's TLK files into human-readable XML. TLK are .Dq talk tables , a list of strings indexed by an ID, used for all user-visible text in a BioWare game. All strings for a campaign or module are usually collected in one file for each supported language, and languages with sentences that vary wildly depending on whether the player character is male or female use a second TLK with strings for the female version. .Pp There's two distinct TLK formats. One is a whole separate file format (which uses version IDs V3.0 and V4.0), the other is a GFF (and uses version IDs V0.2 and V0.5). Within those two major versions, the differences are smaller: V4.0 removed fields for each string not needed anymore, and V0.5 compresses strings using a Huffman tree. This tool can read all of these variants and produces a human-read XML file. .Pp Because these files contain localized string data, it is important to know the encoding of those strings. Unfortunately, the TLK files do not contain information about the encoding. Version 3.0 and 4.0 contain a language identifier, but the meaning of that varies between games. V0.2 and V0.5 even lack those completely. However, due to the Huffman-nature of V0.5 strings, the encoding there is fixed to little-endian UTF-16, and strings in V0.2 files are also usually in little-endian UTF-16 (with the exceptions of files found in the Nintendo DS game .Em Sonic Chronicles: The Dark Brotherhood ) . To manually select the encoding, this tool provides a wide range command line options for various encodings. .Pp Alternatively, the game this TLK is from can be specified and .Nm will read the strings in an appropriate encoding for that game and the language ID found in the TLK. Please note that this does not work for the game .Em Sonic Chronicles: The Dark Brotherhood , since its TLK files do not provide a language ID. .Sh OPTIONS .Bl -tag -width xxxx -compact .It Fl h .It Fl Fl help Show a help text and exit. .It Fl Fl version Show version information and exit. .It Fl Fl cp1250 Read strings as Windows CP-1250. Eastern European, Latin alphabet. .It Fl Fl cp1251 Read strings as Windows CP-1251. Eastern European, Cyrillic alphabet. .It Fl Fl cp1252 Read strings as Windows CP-1252. Western European, Latin alphabet. .It Fl Fl cp932 Read strings as Windows CP-932. Japanese, extended Shift-JIS. .It Fl Fl cp936 Read strings as Windows CP-936. Simplified Chinese, extended GB2312 with GBK codepoints. .It Fl Fl cp949 Read strings as Windows CP-949. Korean, similar to EUC-KR. .It Fl Fl cp950 Read strings as Windows CP-950. Traditional Chinese, similar to Big5. .It Fl Fl utf8 Read strings as UTF-8. .It Fl Fl utf16le Read strings as little-endian UTF-16. .It Fl Fl utf16be Read strings as big-endian UTF-16. .It Fl Fl nwn Read strings in an encoding appropriate for .Em Neverwinter Nights . .It Fl Fl nwn2 Read strings in an encoding appropriate for .Em Neverwinter Nights 2 . .It Fl Fl kotor Read strings in an encoding appropriate for .Em Knights of the Old Republic . .It Fl Fl kotor2 Read strings in an encoding appropriate for .Em Knights of the Old Republic II . .It Fl Fl jade Read strings in an encoding appropriate for .Em Jade Empire . .It Fl Fl witcher Read strings in an encoding appropriate for .Em The Witcher . .It Fl Fl dragonage Read strings in an encoding appropriate for .Em Dragon Age: Origins . .It Fl Fl dragonage2 Read strings in an encoding appropriate for .Em Dragon Age II . .El .Bl -tag -width xx -compact .It Ar input_file The TLK file to convert. .It Ar output_file The XML file will be written there. If no output file is specified, the XML data is written to .Dv stdout . The encoding of the XML stream is always UTF-8. .El .Sh EXAMPLES Convert the CP-1252 TLK .Pa file1.tlk into an XML file: .Pp .Dl $ tlk2xml --cp1252 file1.tlk file2.xml .Pp Convert the UTF-16LE TLK .Pa file1.tlk into an XML file on .Dv stdout : .Pp .Dl $ tlk2xml --utf16le file1.tlk .Pp Convert the TLK .Pa file1.tlk from Neverwinter Nights into an XML file: .Pp .Dl $ tlk2xml --nwn file1.tlk file2.xml .Pp Convert the UTF-8 TLK .Pa file1.tlk into an XML file on .Dv stdout , modify it using .Xr sed 1 and use .Xr xml2tlk 1 to write it back into a TLK: .Bd -literal -offset xxxxxx $ tlk2xml --utf8 file1.tlk | sed -e 's/gold/candy/g' | xml2tlk \e --utf8 --version30 file2.tlk .Ed .Sh "SEE ALSO" .Xr gff2xml 1 , .Xr ssf2xml 1 , .Xr xml2tlk 1 .Pp More information about the xoreos project can be found on .Lk https://xoreos.org/ "its website" . .Sh AUTHORS This program is part of the xoreos-tools package, which in turn is part of the xoreos project, and was written by the xoreos team. Please see the .Pa AUTHORS file for details.