[vala] tests: Replace test for bug 743877 using g_get_filename_charsets()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] tests: Replace test for bug 743877 using g_get_filename_charsets()
- Date: Wed, 18 Mar 2015 19:00:47 +0000 (UTC)
commit 752dd3626c58dc77dfd0d89e89a843615f825636
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Mar 18 19:57:35 2015 +0100
tests: Replace test for bug 743877 using g_get_filename_charsets()
Preserve compatibility with glib >= 2.24
tests/methods/bug743877.vala | 8 +++-----
vapi/glib-2.0.vapi | 1 +
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/tests/methods/bug743877.vala b/tests/methods/bug743877.vala
index 9049724..127aaf0 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 d0c55d7..aa46909 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 {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]