$ python3 -c 'f=open("file.txt","w");print(("A"*100+"\n")*1000+"Ö",file=f)'
$ ll file.txt
-rw-rw-r-- 1 bytecommander bytecommander 101003 Jul 15 09:24 file.txt
$ file file.txt
file.txt: ASCII text
$ python3 -c 'f=open("file.txt","w");print(("A"*100+"\n")*500+"Ö",file=f)'
$ ll file.txt
-rw-rw-r-- 1 bytecommander bytecommander 50503 Jul 15 09:25 file.txt
$ file file.txt
file.txt: UTF-8 Unicode text