[folks] TestCase: set locale from the environment



commit 93d0f7d220588afc3b7521d2428426a8863267dd
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Wed Mar 20 11:34:37 2013 +0000

    TestCase: set locale from the environment
    
    This fixes an annoyance I'd had for a while: UTF-8 arrows etc.
    in debug messages came out as "?", because until we call setlocale()
    we're in the C locale, whose character set is ASCII (and some layer
    of library responds by transcoding our strings into ASCII).
    
    With this change, running the tests in en_GB.UTF-8 results in
    Unicode arrows and more comprehensible output.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=696179
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Philip Withnall <philip tecnocode co uk>

 tests/lib/test-case.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/tests/lib/test-case.vala b/tests/lib/test-case.vala
index 3956999..c2a211a 100644
--- a/tests/lib/test-case.vala
+++ b/tests/lib/test-case.vala
@@ -39,6 +39,8 @@ public abstract class Folks.TestCase : Object
 
   public TestCase (string name)
     {
+      Intl.setlocale (LocaleCategory.ALL, "");
+
       LogAdaptor.set_up ();
       this._suite = new GLib.TestSuite (name);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]