[gtkada] Is Glib.Convert buggy?
Adrian Knoth
adi at drcomp.erfurt.thur.de
Sun Jun 16 16:31:54 CEST 2002
Hi,
related to the question two days ago I'm now using Locale_To_UTF8.
In order to provide consistency through the whole application I
also wrote a little helper-program which converts the database to
UTF8. I called it db2utf8. Unfortunately it crashes after processing
the 3rd entry (row in DB). After removing the calls to Locale_To_UTF8
is runs perfectly (but of course without converting the strings :)
Here is the error:
raised INTERFACES.C.STRINGS.DEREFERENCE_ERROR : i-cstrin.adb:182
The code-fragment is:
query := "INSERT INTO tmp_kunden values ('" & buffers(1) & "','"
& utf8.To_String(buffers(2)) & "','"
& utf8.To_String(buffers(3)) & "','"
& utf8.To_String(buffers(4)) & "','"
& utf8.To_String(buffers(5)) & "','"
& buffers(6) & "','"
& utf8.To_String(buffers(7)) & "','"
& buffers(8) & "','"
& buffers(9) & "','"
& buffers(10) & "','"
& utf8.To_String(buffers(11)) & "','"
& buffers(12) & "');";
which always runs fine three times and then crashes. buffers is an array
of Unbounded_Strings, utf8.To_String is:
function To_String(Input: in Unbounded_String) return String
is
begin
return Locale_To_UTF8(Ada.Strings.Unbounded.To_String(Input));
end To_String;
I cannot exactly judge where the error is, because i-cstrin.adb line 182
is Strlen. Perhaps the gtk(C)-functions call it?
--
mail: adi at thur.de http://adi.thur.de PGP: v2-key via keyserver
Siehst du die Graeber dort im Schnee, das sind die Raucher von HB.
More information about the gtkada
mailing list