How do you saving html files local?
Have to be careful and keep
Python 3 default encoding is
Can use chardet to Detect encoding.
Running a couple of html files.
Have to be careful and keep
utf-8
all the way.Quote:â—¾%20%20%20%20%20WPCA1_files/image001.jpgYou see that this is messed up,and the encoding can be wrong(saving wrong) before you read it in.
Python 3 default encoding is
utf-8
,Python 2 had ascii
as default encoding. Can use chardet to Detect encoding.
Running a couple of html files.
E:\div_code\img λ chardetect foo.html bar.html foo.html: UTF-8-SIG with confidence 1.0 bar.html: UTF-8-SIG with confidence 1.0 # Run code as i posted E:\div_code\img λ python img.py img_chania.jpg smiley.gifFile are in
bar.zip
if you want to test.
Attached Files
bar.zip (Size: 436 bytes / Downloads: 181)