[Vala] Error with OptionEntry and unicode string.



This is the example:

//Begin
class Main : Object{
    private static string name = "";
    private const OptionEntry[] options = {{"name", 'n', 0,
OptionArg.STRING, ref name, "Cerca per nome", "nome"}, {null}};

    public static int main(string[] args){
        var opt_context = new OptionContext ("Prova");
        opt_context.set_help_enabled (true);
        opt_context.add_main_entries (options, null);
        opt_context.parse (ref args);
        print("name: " + name + "\n");
        return 0;
    }
}
//End

If i call "-n" with a ascii string, it works, but with a unicode string
I've got an error:

./par -n รจรจ

** (par:25597): CRITICAL **: file
/home/walter/pyLabrador/TRUNK/Vala/par.vala.c: line 66: uncaught error:
Invalid byte sequence in conversion input (g_convert_error, 1)

My LANG variable is: it_IT.UTF-8

Thanks.
Walter


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