Skip to content

Commit

Permalink
hardening UTF-8 conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
padams committed Jan 25, 2022
1 parent 4ea24ce commit 197c8a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion owa_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ public static function utf8Encode($string) {
return $string;
} else {
if (function_exists('iconv')) {
return iconv('UTF-8','UTF-8//TRANSLIT', $string);
return iconv(mb_detect_encoding( $string ),'UTF-8//TRANSLIT', $string);
} else {
// at least worth a try
return utf8_encode($string);
Expand Down

0 comments on commit 197c8a9

Please sign in to comment.