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

Ludo Brands ludo.brands at free.fr
Wed Dec 14 17:11:45 CET 2011


 

-----Message d'origine-----
De : ik [mailto:idokan at gmail.com] 
Envoyé : mercredi 14 décembre 2011 17:05
À : Lazarus mailing list
Objet : Re: [Lazarus] RE : g_variant_new_string: assertion `g_utf8_validate
(string, -1, NULL)' failed


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) :(


 

AFAIK, the use of constref for cdecl parameters is wrong in libnotify.pas.
 
Ludo
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111214/b1f7550e/attachment-0003.html>


More information about the Lazarus mailing list