0

I am trying to use Flask and for some reason it is rendering with a byte-order mark that's a quirk of something using UTF8 (the mark is  in particular for people googling the same issue).

I do not know how to get rid of it or if it is a source of some of my problems. I am using Flask on Windows 10.

I wish I knew how to reproduce this issue.

hao ramirez
  • 235
  • 1
  • 6

1 Answers1

2

The string (BOM) is most likely included in your template file. Open/save it in some editor which doesn't include unnecessary symbols in UTF-8 files. For example Notepad++.

viraptor
  • 33,322
  • 10
  • 107
  • 191
  • I found that when working in Visual Studio 2015, in a Python web project (using Flask or otherwise), if I select "HTML Page" from the "Add New Item" dialog then the newly added HTML file will be configured to save with the BOM. However, if I select "Text File" from the "Add New Item" dialog, but name it "page.html" (or whatever), it will save without the BOM. – Richard Gieg Aug 07 '16 at 01:46
  • If using Visual Studio and you need to fix files that already contain the BOM, see [this answer](http://stackoverflow.com/a/5411486/4704976). – Richard Gieg Aug 07 '16 at 01:52