Topic: _decodeUTF8Data method

Hello everybody!

I have problem with decoding form field values.

I use field names such as "form_part1[field1]", "form_part1[field2]", "form_part2[field1]", "form_part2[field2]". As a result, form fields values are passed to xajax function as an array: array('form_part1' => array('field1' => 'value', 'field2' => 'value'), 'form_part2' => array('field1'=>'value', 'field2'=>'value')). It's very useful for me to aggregate data in such a way.

Unfortunately, _decodeUTF8Data method treats array of values passed to function as array of scalars and it does not decode data passed in a way I do. Does any workaround exist? In my opnion _decodeUTF8Data method should work recursively and it's easy to modify it but I'd prefer to use xajax library without any modifications.

Regards,

Artur Sudnik

Re: _decodeUTF8Data method

I'd suggest adding following piece of code at the top of this method:

function _decodeUTF8Data($sData)
{
    if(is_array($sData)) {
       foreach ($sData as $key => $value) {
           $sData[$key] = $this->_decodeUTF8Data($value);
       }   
       return $sData;
    }

[...]