Ignore:
Timestamp:
04/11/12 14:15:00 (12 years ago)
Author:
acoutinho
Message:

Ticket #2612 - Evento com erro ao importar via ExpressoMail?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/converter.php

    r5903 r5916  
    2424                $args = array('Error' => 'No source file'); 
    2525 
    26 if( !isset($_REQUEST['readable']) || !$_REQUEST['readable']){ 
    27         require_once 'Sync.php'; 
     26        if( isset($args[0]) && empty($args[0]) ) 
     27                echo json_encode($args); 
     28        else{ 
     29                if(!isset($_REQUEST['readable']) || !$_REQUEST['readable']){ 
     30                        require_once 'Sync.php';                         
     31                        $args = toUtf8($args); 
     32                        echo json_encode($args); 
     33                }else 
     34                        print_r(serialize($args)); 
     35        } 
    2836 
    29         echo json_encode($args); 
    30 }else 
    31         print_r(serialize($args)); 
     37        function srtToUtf8($data){ 
     38                return mb_convert_encoding( $data , 'UTF-8' , 'UTF-8 , ISO-8859-1' ); 
     39        } 
    3240 
     41        function toUtf8($data){ 
     42                if(is_array($data)){    
     43                        $return = array(); 
     44                        foreach ($data as $i => $v) 
     45                           $return[srtToUtf8($i)] = (is_array($v)) ? toUtf8($v) : srtToUtf8($v); 
     46                         
     47                        return $return; 
     48                }else 
     49                   return srtToUtf8($data); 
     50        } 
     51         
     52         
    3353?> 
Note: See TracChangeset for help on using the changeset viewer.