From: Rico Tzschichholz Date: Wed, 18 Mar 2015 18:57:35 +0000 (+0100) Subject: tests: Replace test for bug 743877 using g_get_filename_charsets() X-Git-Tag: 0.27.2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=752dd3626c58dc77dfd0d89e89a843615f825636;p=thirdparty%2Fvala.git tests: Replace test for bug 743877 using g_get_filename_charsets() Preserve compatibility with glib >= 2.24 --- diff --git a/tests/methods/bug743877.vala b/tests/methods/bug743877.vala index 9049724b8..127aaf060 100644 --- a/tests/methods/bug743877.vala +++ b/tests/methods/bug743877.vala @@ -1,11 +1,9 @@ void main () { Intl.setlocale (); - string input_str = "Álvaro"; - string[] alternates; - var tokens = input_str.tokenize_and_fold (null, out alternates); + string[] charsets; + var is_utf8 = GLib.get_filename_charsets (out charsets); - assert ("álvaro" in tokens); - assert ("alvaro" in alternates); + assert (charsets.length != -1); } diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index d0c55d78e..aa4690965 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -2266,6 +2266,7 @@ namespace GLib { public static string convert (string str, ssize_t len, string to_codeset, string from_codeset, out size_t bytes_read = null, out size_t bytes_written = null) throws ConvertError; public static bool get_charset (out unowned string charset); + public static bool get_filename_charsets ([CCode (array_length = false, array_null_terminated = true)] out string[] charsets); [SimpleType] public struct IConv {