[Lazarus] RE : g_variant_new_string: assertion `g_utf8_validate (string, -1, NULL)' failed

ik idokan at gmail.com
Wed Dec 14 17:04:51 CET 2011


2011/12/14 Ludo Brands <ludo.brands at free.fr>

> **
>
>
>
> Hello,
>
> I've created a short example<https://github.com/ik5/libnotify-fpc/blob/master/tests/test_notify.lpr>to display how to use libnotify in Pascal.
> The problem is that I'm getting the following exception:
>
> (process:7633): GLib-CRITICAL **: g_variant_new_string: assertion
> `g_utf8_validate (string, -1, NULL)' failed
> (process:7633): GLib-CRITICAL **: g_variant_new_string: assertion
> `g_utf8_validate (string, -1, NULL)' failed
> (process:7633): GLib-CRITICAL **: g_variant_new_string: assertion
> `g_utf8_validate (string, -1, NULL)' failed
>
> The text as you can see, is pure "ASCII", so what am I missing or doing
> wrong here ?
>
> Ido
>
>
> Forgot to call gtk_init?
>

That's create now gibrish as text :(

The original code that I tested was in C:
#include <libnotify/notify.h>
void main () {
  notify_init ("Hello world!");
  NotifyNotification * Hello = notify_notification_new ("Hello world",
"This is an example notification.", "dialog-information");
  notify_notification_show (Hello, NULL);
  notify_uninit ();
}

And after compiling it as follows:
gcc -o notify `pkg-config --cflags --libs libnotify` notify.c

It properly display the text, however the Pascal code does not, even with
gtk_init(@argc, @argv) :(




>
> Ludo
>
>
Ido

> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111214/f8c40010/attachment-0003.html>


More information about the Lazarus mailing list