Add utf8 encoding to data example to let it work in windows

This commit is contained in:
job-b
2023-09-21 07:48:47 +02:00
committed by GitHub
parent f9ec776a58
commit bbc42cec06

View File

@@ -38,7 +38,7 @@ words = ""
with context.search("type:document") as search_result:
for trace in search_result:
if "text" in trace.data_types:
with io.TextIOWrapper(trace.open(stream='text')) as content:
with io.TextIOWrapper(trace.open(stream='text'), encoding="utf-8") as content:
words += content.read()
words