=== modified file 'src/Services/Encoding.vala' --- src/Services/Encoding.vala 2013-05-01 18:28:34 +0000 +++ src/Services/Encoding.vala 2014-02-11 22:28:06 +0000 @@ -260,7 +260,7 @@ public static string get_charset (string path) { // Get correct encoding via chardect.py script - const string FALLBACK_CHARSET = "UTF-8"; + const string FALLBACK_CHARSET = "ISO-8859-1"; string script = Constants.SCRIPTDIR + "/chardetect.py"; string command = "python " + script + " \"" + path.replace ("\\ ", " ") + "\""; string? charset = null; @@ -284,10 +284,12 @@ string? encoding = null; string? encoded_content = null; - encoding = get_charset (file.get_path ()); - try { - encoded_content = GLib.convert (content, -1, "UTF-8", encoding); + encoded_content = content.locale_to_utf8 (-1, null, null, null); + if ( encoded_content == null ) { + encoding = get_charset (file.get_path ()); + encoded_content = GLib.convert (content, -1, "UTF-8", encoding); + } } catch (GLib.ConvertError ce) { warning (ce.message); }