For some reason, whenever I try to append text to a file, a bunch of -what I believe are- Asian characters get appended instead.
Here's my code:
with open(rutaCuentasCFG+'cuentas.cfg', 'r') as file:
    contFile = file.readlines()
cantidadCuentas = len(contFile)
with open('C:\Sandboxie.ini', 'a', encoding='utf-8') as file:
    for cont in range(1,len(contFile)+1):
        config = ['\n','\n'+'[steam'+str(cont)+']'+'\n',
                  '\n',
                  'Enabled=y'+'\n',
                  'ConfigLevel=7'+'\n',
                  'AutoRecover=y'+'\n',
                  'Template=BlockPorts'+'\n',
                  'Template=LingerPrograms'+'\n',
                  'Template=Firefox_Phishing_DirectAccess'+'\n',
                  'Template=AutoRecoverIgnore'+'\n',
                  'RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%'+'\n',
                  'RecoverFolder=%Personal%'+'\n',
                  'RecoverFolder=%Favorites%'+'\n',
                  'RecoverFolder=%Desktop%'+'\n',
                  'BorderColor=#00FFFF,ttl'+'\n',
                  'OpenPipePath='+rutaSteamIdle+'\\SteamIdle\\']
        for line in config:
            file.write(line)
This is the result I'm getting: http://puu.sh/4f6y5.png
And this is the one I should get: http://puu.sh/4f6CE.png
I also tried without specifying the encoding with the same results.
 
     
    