[PYTHON] JetBrains_Learning Notes_003

About the beginning of utf-8 (BOM)

For programs that assume ASCII, BOM may not be able to process normally, so BOM investigated what and how to remove it.

What is BOM

--When I processed a certain csv file with python, "\ ufeff" appeared in the head. utf8_bom

――The apparent "\ ufeff" is a mark in the data to tell the program the beginning of the text in UTF-8. This is called BOM (byte order mark), but when it is displayed in Unicode, it becomes "\ ufeff".

3 ways to remove BOM

--How to cancel with BOM --Method 1: Specify in pycharm settings BOM_01

--Method 2: Execute "Remove BOM" in the right-click menu of the file. BOM_02

--Method 3: If [encoding = "utf-8-sig"] is specified at the time of coding, BOM will not be displayed. BOM_03

Recommended Posts

JetBrains_Learning Notes_003
SQLAlchemy notes
pyenv notes
SQL notes
Pandas notes
Sphinx notes
django notes
Jupyter_Learning Notes_000
Django notes
pandas self-study notes
Python scraping notes
Mecab installation notes
Python study notes _000
Python learning notes
concurrent.futures Usage notes
Theano installation notes
Jupyter study notes_006
[Django] as_view () notes
Notes about with
Python beginner notes
Theano's basic notes
Python study notes_006
Linux study notes
Notes on Flask
Django's order_by notes
Django Template notes
python C ++ notes
pyenv installation notes
Python study notes _005
Python grammar notes
Python Library notes
Hydrogen installation notes
Jupyter study notes_008
python personal notes
Jupyter study notes_004
Notes about pytorch
Jupyter study notes_001
python pandas notes
[Django] JWT notes
Python study notes_001
python learning notes
Python3.4 installation notes
Cabocha installation notes