1

Python i UTF8 i UnicodeDecodeError

python.py

with open("datoteka.md","r") as fajl: print (fajl.read())

Rezultat:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x%RANDOM1% in position %RANDOM2%: character maps to <undefined>

python2.py

with open("datoteka.md","r",encoding="utf-8") as fajl: print (fajl.read())

Rezultat:

blabla serkenj šđčćž ŠĐČĆŽ itd


python print utf8 utf-8 datoteka file xpython xprint xutf8 xutf-8 xdatoteka xfile xerror error