Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mb_convert_encoding crashes PHP on Windows #10627

@liviuconcioiu

Description

@liviuconcioiu

Description

The following code:

<?php

if (($handle = fopen('https://www.google.com/', 'r')) !== false) {
    while (($data = fgetcsv($handle, 1000, ";")) !== false) {
        $data = mb_convert_encoding($data, 'UTF-8', 'auto');
        print_r($data);
    }
    fclose($handle);
}

Resulted in this output:

Faulting application name: php-cgi.exe, version: 8.2.3.0, time stamp: 0x63eb5a8b
Faulting module name: php_mbstring.dll, version: 8.2.3.0, time stamp: 0x63eb5fc1
Exception code: 0xc0000005
Fault offset: 0x000000000002faeb
Faulting process id: 0x990c
Faulting application start time: 0x01d944767c2c1fad
Faulting application path: z:\nginx\php\php-cgi.exe
Faulting module path: z:\nginx\php\ext\php_mbstring.dll
Report Id: 32e2f828-cdb9-43ea-82bb-91f6816d7a8d
Faulting package full name: 
Faulting package-relative application ID: 

DebugDiag Analysis Report

php-cgi.exe_230219_162706_MultipleRules.zip

PHP Version

8.2.3

Operating System

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions