Skip to content

Commit 05bdb1e

Browse files
Issue with non-English text #240
1 parent b7fbfe0 commit 05bdb1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

classes/Visualizer/Source.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ protected function _normalizeData( $data ) {
222222
}
223223
break;
224224
case 'string':
225-
$data[ $i ] = utf8_encode( $data[ $i ] );
225+
// condition introduced for Issue with non-English text #240 where languages such as Hebrew get messed up.
226+
if ( function_exists( 'mb_detect_encoding' ) && mb_detect_encoding( $data[ $i ] ) !== 'UTF-8' ) {
227+
$data[ $i ] = utf8_encode( $data[ $i ] );
228+
}
226229
break;
227230
}
228231
}

0 commit comments

Comments
 (0)