translate/translate — pull request #7 by imankulov (2012-10-11 17:22:46+00:00)
Title: Fix bug with the BOM symbol in the middle of contents

Please consider merging yet another minor fix to upstream.

The problem is that encoding to utf-16 prepends BOM to every string, so that it's no longer safe to concatenate two utf-16 encoded strings.

Thus, left and right part of the equality don't match

>>> u'foo'.encode('utf-16') == ''.join(c.encode('utf-16') for c in u'foo')
False

Instead text should be concatenated first, then converted to utf-16