chrispiech / probabilityForComputerScientists

86 stars 68 forks source link

Fix UnicodeDecodeError by specifying UTF-8 encoding when opening files #83

Closed alex-stoica closed 1 week ago

alex-stoica commented 5 months ago

Fix UnicodeDecodeError by specifying UTF-8 encoding when opening files

Description

This pull request addresses the UnicodeDecodeError encountered on Windows 11 when reading files with the default system encoding (cp1252). By specifying UTF-8 encoding explicitly, we ensure that the file can be read correctly, preventing the decode error.

Besides these issue, i've removed unnecessary comments and lines from the method

Changes Made

Tests

Tested locally and verified that the error is resolved.