Skip to content
  • Me's avatar
    ui.filechooser: Default to autodetecting encoding (#350) · cccafb91
    Me authored
    When we added the custom file chooser that allowed encoding selection,
    the default encoding behaviour changed. Previously, there would be no
    custom encoding, so the default behaviour would be used: try the user-
    configured encodings, then try the GtkSourceView list for the current
    locale.
    
    With the custom filechooser, the default encoding selection was whatever
    the current locale was, and so instead of using the user-configured
    encoding list, we would always try the current locale encoding. This is
    fine in most scenarios because users' locale encoding is typically
    UTF-8... but if a user had something more exciting as their locale
    things would go badly.
    
    More importantly, because the user had chosen a locale, we didn't try
    the user-configured locales. While this behaviour is arguably correct
    for when the user actually chooses an encoding, it's definitely not
    right when the user just doesn't select one and gets the locale-default
    encoding.
    
    This change fixes all of this by simply adding an "Autodetect" option to
    the custom filechooser, and using that by default.
    cccafb91