PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 2.1.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v2.1.4
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Source/Csv.php +6 -4 3.0.92.1.4 View file →
@@ -61,8 +61,9 @@
61 61 */
62 62 private function _fetchSeries( &$handle ) {
63 63 // read column titles
64 64 $labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
65 + $labels = array_map( 'utf8_encode', $labels );
65 66 // read series types
66 67 $types = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
67 68
68 69 if ( ! $labels || ! $types ) {
@@ -77,16 +78,14 @@
77 78 $handle = $this->_get_file_handle();
78 79
79 80 // re read the labels and empty types array
80 81 $labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
82 + $labels = array_map( 'utf8_encode', $labels );
81 83 $types = array();
82 84 }
83 85
84 86 for ( $i = 0, $len = count( $labels ); $i < $len; $i++ ) {
85 87 $default_type = $i == 0 ? 'string' : 'number';
86 -
87 - $labels[ $i ] = $this->toUTF8( $labels[ $i ] );
88 -
89 88 $this->_series[] = array(
90 89 'label' => $labels[ $i ],
91 90 'type' => isset( $types[ $i ] ) ? $types[ $i ] : $default_type,
92 91 );
@@ -107,9 +106,12 @@
107 106 protected function _get_file_handle( $filename = false ) {
108 107 // set line endings auto detect mode
109 108 ini_set( 'auto_detect_line_endings', true );
110 109 // open file and return handle
111 - return fopen( $filename ? $filename : $this->_filename, 'rb' );
110 + $fc = iconv( 'ISO-8859-1', 'utf-8', file_get_contents( $filename ? $filename : $this->_filename ) );
111 + $tmp = tempnam( sys_get_temp_dir(), rand() );
112 + file_put_contents( $tmp, $fc );
113 + return fopen( $tmp, 'rb' );
112 114 }
113 115
114 116 /**
115 117 * Fetches information from source, parses it and builds series and data arrays.