Downloads: strings_bin_converter 0.72

strings_bin_converter 0.72

Uploaded by alpaca - December 28, 2006
Author Author alpaca
File Size File Size 2.1 KB
Downloads Downloads 29,806
+ Download
This allows you to convert the unpacked .strings.bin files to .txt files.
It's especially useful if you have a non-English version of the game.




February 13, 2008 at 12:03 PM
In Clouds across europe there is no such thing as historic_events and vanila folder there in no TEXT folder!
June 14, 2009 at 11:51 AM
very nice!
September 24, 2011 at 01:54 PM

Any advice how to deal with this?
Ramesses II The Great
December 26, 2011 at 08:17 PM
This file converter does not work =(
Sir Luock
February 06, 2012 at 10:46 AM
It does not work!
February 24, 2012 at 06:00 PM
You need to get Python first for it to work. It says so in the readme
April 09, 2012 at 01:44 PM
I've downloaded python, installed, run the converter... and the .bin files are still .bin files. cmd prompt flashes for a second, vanishes, and nothing changes. Does the change not take place right away, or is there a glitch?
April 09, 2012 at 01:50 PM
April 09, 2012 at 01:52 PM
April 09, 2012 at 01:55 PM

C:\Program Files\SEGA\Medieval II Total War\data\text> a
Traceback (most recent call last):
File "C:\Program Files\SEGA\Medieval II Total War\data\text\strings_bin_conver", line 42, in <module>
for filepath in os.listdir(''):
WindowsError: [Error 3] The system cannot find the path specified: ''

C:\Program Files\SEGA\Medieval II Total War\data\text>pause
Press any key to continue . . .

any help with this? command prompt pops up with this

Spoiler Alert, click show to read: 
sorry for the triple post...i deleted the previous three, but for some reason they're still there...
April 26, 2012 at 12:47 PM
^I have the exact same problem, any help would be very handy
July 04, 2012 at 08:24 PM
I finally debugged this for myself. I have python 3.x installed, and since python is a piece of :wub:, they aren't backwards compatible with older scripts. And it doesn't work in THREE different ways.

1) Some syntax is screwed up with on of the comments.
So you have to right-click the file and open as a txt file with notepad or something, comment out the "print 'Converting file '+filepath+'('+str(i)+' of '+str(len(arr))+')'" line with a "#" so that it looks like this:
#print 'Converting file '+filepath+'('+str(i)+' of '+str(len(arr))+')'
They are just comments so I didn't feel like learning how to fix it, you'll know it worked when you see a bunch of new files pop up in the text directory. but if you want to figure it out, its probably something to do with the changes to the 'str' function between python 2 and python 3.

2) os.listdir(''): Doesn't work the way it did in python 2.x apparently, but thats ok you can copy-paste in the complete directory of your data/text folder, mines in steam:
os.listdir('C:/Program Files (x86)/Steam/steamapps/common/Medieval II Total War/data/text'):

Next you'll get an error about 'unicode' not being defined.
To fix this replace the instances where you find 'unicode' with 'str'.
tagstr += str(, 'UTF-16')
screenstr += str(tempstr, 'UTF-16')

My entire file that seems to work for me:

Spoiler Alert, click show to read: 
# (c) 2006 Stefan Reutter (alias alpaca)
# Version 0.72
# A script to convert a number of MTW2 .strings.bin files to their .txt counterparts

import sys
import codecs
import struct
import os

def convertFile(filepath):
    Takes a type 2 .strings.bin file and converts it to a text file
    f = open(filepath+'.strings.bin', 'rb')
    (style1,) = struct.unpack('h',
    (style2,) = struct.unpack('h',
    if style1 == 2 and style2 == 2048:
        fw =, encoding='UTF-16', mode='w')
        (length,) = struct.unpack('i',
        for string in range(length):
            (strlen,) = struct.unpack('h',
            tagstr = ''
            for i in range(strlen):
                tagstr += str(, 'UTF-16')
            (strlen,) = struct.unpack('h',
            screenstr = ''
            for i in range(strlen):
                tempstr =
                (e,) = struct.unpack('H',tempstr)
                if e == 10:
                    screenstr += '\\n'
                    screenstr += str(tempstr, 'UTF-16')

if sys.argv[1] == 'all':
    arr = []
    i = 1
    #for filepath in os.listdir(''):
    for filepath in os.listdir('C:/Program Files (x86)/Steam/steamapps/common/Medieval II Total War/data/text'):
        if filepath.find('.strings.bin') > -1:
    for filepath in arr:
        #print 'Converting file '+filepath+'('+str(i)+' of '+str(len(arr))+')'
    for i in range(len(sys.argv)-1):
        path = sys.argv[i+1]
August 31, 2012 at 10:00 AM
^ Above solution didn't work,
June 16, 2013 at 07:41 AM
Thanks Worked fine, You need PYTHON 2.5 You cannot get Old or newer versions. ONLY 2.5
November 02, 2013 at 03:25 AM