From 13a0ed064b4c4c4b5978d61cc6ec0950dcdcf870 Mon Sep 17 00:00:00 2001 From: Akash NP <91617769+9akashnp8@users.noreply.github.com> Date: Sat, 15 Apr 2023 05:06:03 +0530 Subject: [PATCH] add encoding to avoid UnicodeDecodeError (#2908) **About** Specify encoding to avoid UnicodeDecodeError when reading .txt for users who are following the tutorial. **Reference** ``` return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1205: character maps to ``` **Environment** OS: Win 11 Python: 3.8 --- docs/modules/indexes/getting_started.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/indexes/getting_started.ipynb b/docs/modules/indexes/getting_started.ipynb index 58a133ad..0c6a9d59 100644 --- a/docs/modules/indexes/getting_started.ipynb +++ b/docs/modules/indexes/getting_started.ipynb @@ -99,7 +99,7 @@ "outputs": [], "source": [ "from langchain.document_loaders import TextLoader\n", - "loader = TextLoader('../state_of_the_union.txt')" + "loader = TextLoader('../state_of_the_union.txt', encoding='utf8')" ] }, {