From 07c7a6f9c568fc1d1e20eb75c733ca314e36005e Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 28 Mar 2012 14:51:57 +0000 Subject: Added encoding check to it_dbi, improved encoding check (currently lives in it_html) --- it_dbi.class | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index ba0606c..ced925b 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -247,7 +247,11 @@ function _set($tags, $allfields = false) if (substr($field, 0, 1) == '-') # Unquoted value (always added) $r[] = substr($field, 1)."=$value"; else if ($allfields || ($value !== $this->_data[$field])) + { + if ($this->_p['charset'] == "utf8") # NOTE: Mysql charset is simply utf8, not utf-8 + $value = it_html::fix_encoding($value); $r[] = "`$field`=".(isset($value) ? $this->escape_string($value) : 'NULL'); + } } return $r ? 'SET '.implode(', ', $r) : ''; -- cgit v1.2.3