<div dir="ltr"><div class="gmail_quote">2011/12/14 Ludo Brands <span dir="ltr"><<a href="mailto:ludo.brands@free.fr">ludo.brands@free.fr</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div>
<div><font color="#0000ff" face="Arial"></font> </div>
<blockquote dir="ltr" style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#0000ff 2px solid;MARGIN-RIGHT:0px">
<div></div>
<div dir="ltr" align="left" lang="fr"><font face="Tahoma">-----Message d'origine-----<br><b>De :</b> ik
[mailto:<a href="mailto:idokan@gmail.com" target="_blank">idokan@gmail.com</a>] <br><b>Envoyé :</b> mercredi 14 décembre 2011
17:05<br><b>À :</b> Lazarus mailing list<br><b>Objet :</b> Re:
[Lazarus] RE : g_variant_new_string: assertion `g_utf8_validate (string, -1,
NULL)' failed<br><br></font></div><div class="im">
<div dir="ltr">2011/12/14 Ludo Brands <span dir="ltr"><<a href="mailto:ludo.brands@free.fr" target="_blank">ludo.brands@free.fr</a>></span><br></div>
<div class="gmail_quote" dir="ltr">
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><u></u>
<div>
<div>
<div>
<div><font face="Tahoma"><br></font> </div>
<blockquote dir="ltr" style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#0000ff 2px solid;MARGIN-RIGHT:0px">
<div dir="ltr">Hello,<br><br>I've created a <a href="https://github.com/ik5/libnotify-fpc/blob/master/tests/test_notify.lpr" target="_blank">short example</a> to display how to use libnotify in
Pascal.<br>The problem is that I'm getting the following
exception:<br><br>(process:7633): GLib-CRITICAL **: g_variant_new_string:
assertion `g_utf8_validate (string, -1, NULL)' failed<br>(process:7633):
GLib-CRITICAL **: g_variant_new_string: assertion `g_utf8_validate
(string, -1, NULL)' failed<br>(process:7633): GLib-CRITICAL **:
g_variant_new_string: assertion `g_utf8_validate (string, -1, NULL)'
failed<br><br>The text as you can see, is pure "ASCII", so what am I
missing or doing wrong here ? <br><br>Ido<br><span><font color="#0000ff" face="Arial"> </font></span></div></blockquote></div></div>
<div dir="ltr"><span><font color="#0000ff" face="Arial">Forgot to call
gtk_init?</font></span></div></div></blockquote>
<div><br>That's create now gibrish as text :(<br><br>The original code that I
tested was in C:<br>#include <libnotify/notify.h><br>void main ()
{<br> notify_init ("Hello world!");<br> NotifyNotification * Hello
= notify_notification_new ("Hello world", "This is an example notification.",
"dialog-information");<br> notify_notification_show (Hello,
NULL);<br> notify_uninit ();<br>}<br><br>And after compiling it as
follows:<br>gcc -o notify `pkg-config --cflags --libs libnotify`
notify.c<br><br>It properly display the text, however the Pascal code does
not, even with gtk_init(@argc, @argv) :(<br><br><br><span><font color="#0000ff" face="Arial"> </font></span></div></div></div></blockquote>
<div dir="ltr"><span><font color="#0000ff" face="Arial">AFAIK, the use of constref for cdecl parameters is wrong in
libnotify.pas.</font></span></div></div></blockquote><div><br>Indeed that was the problem. So what does constref is used for ?!<br><br>Thanks Ludo<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><span class="HOEnZb"><font color="#888888">
<div dir="ltr"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr"><span><font color="#0000ff" face="Arial">Ludo</font></span></div></font></span></div></blockquote><div><br>Ido <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><span class="HOEnZb"><font color="#888888">
<div dir="ltr"><span> </span></div></font></span></div>
<br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div><br></div>