You are here

TLK<->TXT Converter

7 posts / 0 new
Last post
Aqvilinus
TLK<->TXT Converter

I'm looking for a program that could dump/convert .tlk files to plain text or xml format to make the translation process easier. Is there anything like this for NWN2?

Upd. It seems tlk2xml and xml2tlk from the xoreos-tools package do the job, but I'm getting strange warning messages while converting. Probably something with encoding...

Free Image Hosting at FunkyIMG.com
Free Image Hosting at FunkyIMG.com

Upd. Yes, the problem is that NWN2 tlk uses non-Unicode chars (extended ASCII, for example). Like "û" in Faerûn. These chars are not recognized by the converter. That's a source of warnings, I guess.

So the only solution I see here is to avoid full export of tlk files with such symbols.


  • up
    50%
  • down
    50%
Aqvilinus

Replacing the "nwn2" encoding command-line parameter with "utf8" solved the problem completely.

2vL2H.png
2vL2L.png


  • up
    50%
  • down
    50%
kevL's

very cool.

  • up
    50%
  • down
    50%
NokaS

You do not know about the existence of this program? There is an export and import of text. Https://neverwintervault.org/project/nwn2/other/tool/nwn2-tlk-editor

  • up
    50%
  • down
    50%
Aqvilinus

NokaS
Thank you for the link, I didn't know about this feature. I've had a look at it right away, and it seems to have a serious bug. For some reason it cannot handle large cells with over 4000-5000 symbols. The process is simply cut off and I get an incomplete txt file.

.
  • up
    50%
  • down
    50%
DrMcCoy

Sorry for the late reply here, didn't see this thread until now.

Seems like the NWN2 TLK does something icky: they use both (!) UTF-8 (at least the û in Faerûn is encoded as 0xC3 0xBB, which is UTF-8) and and CP-1252 (at least the ellipsis is encoded as 0x85, which is CP-1252; same for the fraction ½). I have no idea how to fix that yet. :(

So just setting --utf8 will not fix this, this will break other, different strings. Yes, this is really a major bummer. :(

 

I should have guessed that they didn't just roll their own XML parser, for a completely broken XML format, but also completely messed up UTF-8 as well. Ugh. This will be a headache...

  • up
    50%
  • down
    50%
Aqvilinus

I used UTF-8 and didn't have any problems with the ½ symbol or any other. They all are displayed correctly.


  • up
    50%
  • down
    50%