idf.py: add encoding option

Merges https://github.com/espressif/esp-idf/pull/4106

Signed-off-by: Sergei Silnov <sergei.silnov@espressif.com>
This commit is contained in:
H.Ogino 2019-11-04 16:49:14 +01:00 committed by Sergei Silnov
parent 49193beb6d
commit 7e5d30cda4

View file

@ -2,6 +2,7 @@ import os
import re
import subprocess
import sys
from io import open
from .constants import GENERATORS
from .errors import FatalError
@ -96,7 +97,7 @@ def _parse_cmakecache(path):
CMakeCache entries also each have a "type", but this is currently ignored.
"""
result = {}
with open(path) as f:
with open(path, encoding='utf-8') as f:
for line in f:
# cmake cache lines look like: CMAKE_CXX_FLAGS_DEBUG:STRING=-g
# groups are name, type, value