Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Error - Windows - mb_detect_encoding - #739 #1014

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neopheus
Copy link

@neopheus neopheus commented Dec 3, 2020

Fix for error on Windows
Error file moving file: mb_detect_encoding() expects parameter 1 to be string, array given

$rInput = $input;
}
} else {
$rInput = $input;
}

return $input;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$input or $rInput?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is better code:
public function translateFromUtf8($input)
{
if ($input == null)
return $input;
if ($this->isRunningOnWindows()) {
if (is_array($input)) {
for($i = 0 ; $i < count($input);$i++)
$input[$i] = iconv('UTF-8', mb_detect_encoding($input[$i]), $input[$i]);

    } else
        $input = iconv('UTF-8', mb_detect_encoding($input), $input);
}

return $input;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants