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 d59afa4 commit b46f2a1Copy full SHA for b46f2a1
src/EDI/Parser.php
@@ -157,7 +157,9 @@ public function parse(): self
157
158
// Basic sanitization, remove non-printable chars.
159
$lineTrim = \trim($line);
160
- $line = (string) \preg_replace($this->stripChars, '', $lineTrim);
+ if (mb_detect_encoding($line, mb_list_encodings()) !== 'UTF-8') {
161
+ $line = (string) \preg_replace($this->stripChars, '', $lineTrim);
162
+ }
163
$line_bytes = \strlen($line);
164
165
if ($line_bytes !== \strlen($lineTrim)) {
0 commit comments