(file)
Changes encoding of file from UTF-16 to UTF-8
Changes encoding of file from UTF-16 to UTF-8
Changes encoding of file from UTF - 16 to UTF - 8
def changeEncoding(file):
    print("change encoding of file {0} from utf-16 to utf-8".format(file))
    """ Changes encoding of file from UTF-16 to UTF-8
    """
    with open(file, "rb") as f:
        with open("temp.strings", "wb") as f2:
            content = f.read().decode('utf-16')
            f2.write(content.lstrip().encode('utf-8'))
    shutil.move("temp.strings", file)
def changeEncoding ( file ) : print ( "change encoding of file {0} from utf-16 to utf-8" . format ( file ) ) with open ( file , "rb" ) as f : with open ( "temp.strings" , "wb" ) as f2 : content = f . read ( ) . decode ( 'utf-16' ) f2 . write ( content . lstrip ( ) . encode ( 'utf-8' ) ) shutil . move ( "temp.strings" , file )