vice-versa perhaps we also should always ask the user for an encoding as last resortirrespective of configuration settings for saveswe could also try to guess an encoding to apply to the str content ( try utf- latin- and other common types)but our guess may not be what the user has in mind it' likely that users will wish to save file in the same encoding with which it was first openedor initially saved if started from scratch pyedit provides support to do soor else the gui might ask for given file' encoding more than once howeverbecause some users might also want to use save again to overwrite the same file with different encodingthis can be disabled in the configuration module the latter role might sound like save asbut the next bullet explains why it may not similarlyit' not obvious if save as should also reuse the encoding used when the file was first opened or initially saved or ask for new one--is this new file entirelyor copy of the prior text with its known encoding under new namebecause of such ambiguitieswe allow the known-encoding memory feature to be disabled for save asor for both save and save as in the configuration module as shippedit is enabled for save onlynot save as in all casessave encoding prompt dialogs are prefilled with known encoding name as default the ordering of choice seems debatable in general for instanceperhaps save as should fall back on the known encoding if not asking the useras isif configured to not ask and not use known encodingthis operation will fall back on saving per an encoding in the configuration file or the platform default ( utf- )which may be less than ideal for email parts of known encodings and so on because such user interface choices require wider use to resolve wellthe general and partly heuristic policy here is to support every option for illustration purposes in this bookand rely on user configuration settings to resolve choices in practicethoughsuch wide flexibility may turn out to be overkillmost users probably just require one of the policies supported here it may also prove better to allow unicode policies to be selected in the gui itselfinstead of coded in configuration module for instanceperhaps every opensaveand save as should allow unicode encoding selectionwhich defaults to the last known encodingif any implementing this as pull-down encoding list or entry field in the save and open dialogs would avoid an extra pop up and achieve much the same flexibility in pyedit' current implementationenabling user prompts in the configuration file for both opens and saves will have much the same effectand at least based upon use cases 've encountered to datethat is probably the best policy to adopt for most contexts pyedita text editor program/object