We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15f8e0a commit 794e7ccCopy full SHA for 794e7cc
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