We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 053f717 commit da3e71aCopy full SHA for da3e71a
src/Import.php
@@ -80,6 +80,12 @@ public function parse_statements( $sql_file_path ) {
80
81
// phpcs:ignore
82
while ( ( $line = fgets( $handle ) ) !== false ) {
83
+ // Detect and convert encoding to UTF-8
84
+ $detected_encoding = mb_detect_encoding( $line, mb_list_encodings(), true );
85
+ if ( $detected_encoding && 'UTF-8' !== $detected_encoding ) {
86
+ $line = mb_convert_encoding( $line, 'UTF-8', $detected_encoding );
87
+ }
88
+
89
$line = trim( $line );
90
91
// Skip empty lines and comments
0 commit comments