File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -222,9 +222,7 @@ protected function _normalizeData( $data ) {
222
222
}
223
223
break ;
224
224
case 'string ' :
225
- if ( ! function_exists ( 'mb_detect_encoding ' ) || mb_detect_encoding ( $ data [ $ i ] ) !== 'ASCII ' ) {
226
- $ data [ $ i ] = \ForceUTF8 \Encoding::toUTF8 ( $ data [ $ i ] );
227
- }
225
+ $ data [ $ i ] = $ this ->toUTF8 ( $ data [ $ i ] );
228
226
break ;
229
227
}
230
228
}
@@ -233,4 +231,21 @@ protected function _normalizeData( $data ) {
233
231
return $ data ;
234
232
}
235
233
234
+
235
+ /**
236
+ * Converts values to UTF8, if required.
237
+ *
238
+ * @access protected
239
+ *
240
+ * @param string $datum The data to convert.
241
+ *
242
+ * @return string The converted data.
243
+ */
244
+ protected final function toUTF8 ( $ datum ) {
245
+ if ( ! function_exists ( 'mb_detect_encoding ' ) || mb_detect_encoding ( $ datum ) !== 'ASCII ' ) {
246
+ $ datum = \ForceUTF8 \Encoding::toUTF8 ( $ datum );
247
+ }
248
+ return $ datum ;
249
+ }
250
+
236
251
}
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ private function _fetchSeries( &$handle ) {
83
83
84
84
for ( $ i = 0 , $ len = count ( $ labels ); $ i < $ len ; $ i ++ ) {
85
85
$ default_type = $ i == 0 ? 'string ' : 'number ' ;
86
+
87
+ $ labels [ $ i ] = $ this ->toUTF8 ( $ labels [ $ i ] );
88
+
86
89
$ this ->_series [] = array (
87
90
'label ' => $ labels [ $ i ],
88
91
'type ' => isset ( $ types [ $ i ] ) ? $ types [ $ i ] : $ default_type ,
You can’t perform that action at this time.
0 commit comments