<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=fr dir=ltr align=left><FONT face=Tahoma
size=2>-----Message d'origine-----<BR><B>De :</B> ik
[mailto:idokan@gmail.com] <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 dir=ltr>2011/12/14 Ludo Brands <SPAN dir=ltr><<A
href="mailto:ludo.brands@free.fr">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 class=h5>
<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 face=Arial
color=#0000ff> </FONT></SPAN></DIV></BLOCKQUOTE></DIV></DIV>
<DIV dir=ltr><SPAN><FONT face=Arial color=#0000ff>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
class=484140916-14122011><FONT face=Arial color=#0000ff
size=2> </FONT></SPAN></DIV></DIV></BLOCKQUOTE>
<DIV dir=ltr><SPAN class=484140916-14122011><FONT face=Arial color=#0000ff
size=2>AFAIK, the use of constref for cdecl parameters is wrong in
libnotify.pas.</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=484140916-14122011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=484140916-14122011><FONT face=Arial color=#0000ff
size=2>Ludo</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=484140916-14122011> </SPAN></DIV></BODY></HTML>