From 47a40e0ad543e7e6e360266fbf62885787062ec5 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 11 Feb 2011 13:29:58 +0000 Subject: Fix binding length to handle multibyte content --- libpqpp/command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpqpp/command.cpp b/libpqpp/command.cpp index be766c9..eb5a6bf 100644 --- a/libpqpp/command.cpp +++ b/libpqpp/command.cpp @@ -121,9 +121,9 @@ void PQ::Command::bindParamS(unsigned int n, const Glib::ustring & s) { paramsAtLeast(n); - values[n] = strndup(s.c_str(), s.length()); + values[n] = strndup(s.c_str(), s.bytes()); formats[n] = 0; - lengths[n] = s.length(); + lengths[n] = s.bytes(); } void PQ::Command::bindParamT(unsigned int n, const tm * v) -- cgit v1.2.3