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 -1 3.0.62.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,8 +78,9 @@
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++ ) {
@@ -104,9 +106,12 @@
104 106 protected function _get_file_handle( $filename = false ) {
105 107 // set line endings auto detect mode
106 108 ini_set( 'auto_detect_line_endings', true );
107 109 // open file and return handle
108 - 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' );
109 114 }
110 115
111 116 /**
112 117 * Fetches information from source, parses it and builds series and data arrays.