litgpt icon indicating copy to clipboard operation
litgpt copied to clipboard

Specify `UTF-8` encoding for every `open` function

Open Andrei-Aksionov opened this issue 10 months ago • 1 comments

Hi there 👋

One might ask why do we need to specify encoding explicitly, when it should be by default utf-8. Well, not quite.

The default encoding is platform dependent (whatever locale.getpreferredencoding() returns)

Which means that on Windows we can have an error, and that is exactly what recently happened.

Andrei-Aksionov avatar Apr 13 '24 14:04 Andrei-Aksionov

This is a good point. I learned this the hard way when teaching and there were students with various Windows operating systems.

rasbt avatar Apr 13 '24 19:04 rasbt