summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2012-02-16 08:46:35 +0000
committerctrlaltca@gmail.com <>2012-02-16 08:46:35 +0000
commit2c497f6b0136bf77cdf0c3fd700d8213735df5b5 (patch)
treebd4694bf7861a7e92f546e91f1a52d99b5a34f74 /framework/Web
parent1eaa6ca1775d335e2307d958c7f0ad27f7cd6807 (diff)
fixed TActiveList* controls when globalization's charset is not utf8
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/TPage.php16
1 files changed, 15 insertions, 1 deletions
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);