may be the default platform encoding the problem with treating text as bytes the prior sectionsrules may seem complexbut they boil down to the followingunless strings always use the platform defaultwe need to know encoding types to read or write in text mode and to manually decode or encode for binary mode we can use almost any encoding to write new files as long as it can handle the string' charactersbut must provide one that is compatible with the existing data' binary format on reads we don' need to know the encoding mode to read text as bytes in binary mode for displaybut the str content returned by the text widget still requires us to encode to write on saves so why not always load text files in binary mode to display them in tkinter text widgetwhile binary mode input files seem to side-step encoding issues for displaypassing text to tkinter as bytes instead of str really just delegates the encoding issue to the tk librarywhich imposes constraints of its own more specificallyopening input files in binary mode to read bytes may seem to support viewing arbitrary types of textbut it has two potential downsidesit shifts the burden of deciding encoding type from our script to the tk gui library the library must still determine how to render those bytes and may not support all encodings possible it allows opening and viewing data that is not text in naturethereby defeating some of the purpose of the validity checks performed by text decoding the first point is probably the most crucial here in experiments 've run on windowstk seems to correctly handle raw bytes strings encoded in asciiutf- and latin- formatbut not utf- or others such as cp by contrastthese all render correctly if decoded in python to str before being passed on to tk in programs intended for the world at largethis wider support is crucial today if you're able to know or ask for encodingsyou're better off using str both for display and saves to some degreeregardless of whether you pass in str or bytestkinter guis are subject to the constraints imposed by the underlying tk library and the tcl language it uses internallyas well as any imposed by the techniques python' tkinter uses to interface with tk for exampletclthe internal implementation language of the tk librarystores strings internally in utf- formatand decrees that strings passed in to and returned from its api be in this format text