/**
  *
  *
  * @param unknown $array
  * @return unknown
  */
 public static function latin1_to_utf8_array($array)
 {
     if (!is_array($array)) {
         throw new Exception("argument is not an array");
     }
     foreach ($array as $i => $v) {
         if (is_object($v)) {
             $v = (array) $v;
         }
         if (is_array($v)) {
             $v = Encoding::latin1_to_utf8_array($v);
         } elseif (!Encoding::is_utf8($v)) {
             $v = utf8_encode($v);
             if (Encoding::is_cp1252($v)) {
                 $v = Encoding::fix_cp1252_codepoints_in_utf8($v);
             }
         }
         if (is_integer($i)) {
             $array[$i] = $v;
         } else {
             if (!Encoding::is_utf8($i)) {
                 $utf8 = utf8_encode($i);
                 unset($array[$i]);
                 $array[$utf8] = $v;
             } else {
                 $array[$i] = $v;
             }
         }
     }
     return $array;
 }