'Foreign' characters lost when they're at the final position in a list
<p>I have a simple Python (2.7.10) program like this:</p>

<pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-

with open("test.txt") as f:
    input = f.readlines()

for i in input:
    l = list(i)
    mystring = ""
    for j in l:
        mystring += j
        print mystring, '\n',
</code></pre>

<p>The text file, 'test.txt', contains this:</p>

<pre><code>AAAÖÖAAA
</code></pre>

<p>When I run the code however, each time 'Ö' is at the end of mystring, it's being output as '?', like this:</p>

<pre><code>A 
AA 
AAA 
AAA? 
AAAÖ 
AAAÖ? 
AAAÖÖ 
AAAÖÖA 
AAAÖÖAA 
AAAÖÖAAA 
AAAÖÖAAA 
</code></pre>

<p>If I run the code on Python 3 instead (having to change the print statement to 
'<code>print (mystring),</code>'), the output is correct:</p>

<pre><code>A
AA
AAA
AAAÖ
AAAÖÖ
AAAÖÖA
AAAÖÖAA
AAAÖÖAAA
AAAÖÖAAA
</code></pre>

<p>Does anybody know why this is happening and how to fix it? I've tried googling but haven't really found anything.</p>