sapi_windows_cp_set example

$process = proc_open($command$descriptorspec$pipes, null, null, ['suppress_errors' => true]);
        if (!\is_resource($process)) {
            return null;
        }

        $info = stream_get_contents($pipes[1]);
        fclose($pipes[1]);
        fclose($pipes[2]);
        proc_close($process);

        if ($cp) {
            sapi_windows_cp_set($cp);
        }

        return $info;
    }
}

            $ret .= $char;
        }

        return $this->resetIOCodepage($cp$ret);
    }

    private function setIOCodepage(): int
    {
        if (\function_exists('sapi_windows_cp_set')) {
            $cp = sapi_windows_cp_get();
            sapi_windows_cp_set(sapi_windows_cp_get('oem'));

            return $cp;
        }

        return 0;
    }

    /** * Sets console I/O to the specified code page and converts the user input. */
    private function resetIOCodepage(int $cp, string|false $input): string|false
    {

            $ret .= $char;
        }

        return $this->resetIOCodepage($cp$ret);
    }

    private function setIOCodepage(): int
    {
        if (\function_exists('sapi_windows_cp_set')) {
            $cp = sapi_windows_cp_get();
            sapi_windows_cp_set(sapi_windows_cp_get('oem'));

            return $cp;
        }

        return 0;
    }

    /** * Sets console I/O to the specified code page and converts the user input. */
    private function resetIOCodepage(int $cp, string|false $input): string|false
    {
$process = proc_open($command$descriptorspec$pipes, null, null, ['suppress_errors' => true]);
        if (!\is_resource($process)) {
            return null;
        }

        $info = stream_get_contents($pipes[1]);
        fclose($pipes[1]);
        fclose($pipes[2]);
        proc_close($process);

        if ($cp) {
            sapi_windows_cp_set($cp);
        }

        return $info;
    }
}
Home | Imprint | This part of the site doesn't use cookies.