From 2be1beddc9d52664482d9d3e7f57e0a976baf5de Mon Sep 17 00:00:00 2001 From: Detlev Zundel Date: Thu, 31 Mar 2011 18:15:12 +0200 Subject: [PATCH 2/3] Fix and simplify foreign string conversions Use the versions of string->pointer and pointer->string that accept an encoding parameter. The previous version of string->utf8-pointer missed the null termination of the string. Signed-off-by: Detlev Zundel --- sqlite3.scm | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sqlite3.scm b/sqlite3.scm index 8a1e6f1..3369e02 100644 --- a/sqlite3.scm +++ b/sqlite3.scm @@ -61,15 +61,10 @@ ;; Utils ;; (define (string->utf8-pointer s) - (bytevector->pointer (string->utf8 s))) - -(define strlen - (pointer->procedure size_t - (dynamic-pointer "strlen" (dynamic-link)) - '(*))) + (string->pointer s "utf-8")) (define (utf8-pointer->string p) - (utf8->string (pointer->bytevector p (strlen p)))) + (pointer->string p -1 "utf-8")) ;; -- 1.7.4.1