rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -398,8 +398,10 @@ abstract class WC_CSV_Exporter {
$use_mb = function_exists( 'mb_convert_encoding' );
if ( $use_mb ) {
$encoding = mb_detect_encoding( $data, 'UTF-8, ISO-8859-1', true );
$data = 'UTF-8' === $encoding ? $data : utf8_encode( $data );
$is_valid_utf_8 = mb_check_encoding( $data, 'UTF-8' );
if ( ! $is_valid_utf_8 ) {
$data = mb_convert_encoding( $data, 'UTF-8', 'ISO-8859-1' );
}
}
return $this->escape_data( $data );