From 2c497f6b0136bf77cdf0c3fd700d8213735df5b5 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Thu, 16 Feb 2012 08:46:35 +0000 Subject: fixed TActiveList* controls when globalization's charset is not utf8 --- framework/Web/UI/TPage.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'framework/Web') diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 8cd0d407..9d9ac37e 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -284,6 +284,20 @@ class TPage extends TTemplateControl $this->unloadRecursive(); } + protected static function decodeUTF8($data, $enc) + { + if(is_array($data)) + { + foreach($data as $k=>$v) + $data[$k]=self::decodeUTF8($v, $enc); + return $data; + } elseif(is_string($data)) { + return iconv('UTF-8',$enc.'//IGNORE',$data); + } else { + return $data; + } + } + /** * Sets Adapter to TActivePageAdapter and calls apter to process the * callback request. @@ -298,7 +312,7 @@ class TPage extends TTemplateControl if (($g=$this->getApplication()->getGlobalization(false))!==null && strtoupper($enc=$g->getCharset())!='UTF-8') foreach ($this->_postData as $k=>$v) - $this->_postData[$k]=iconv('UTF-8',$enc.'//IGNORE',$v); + $this->_postData[$k]=self::decodeUTF8($v, $enc); Prado::trace("Page onPreInit()",'System.Web.UI.TPage'); $this->onPreInit(null); -- cgit v1.2.3