|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-11-30 16:28 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Package: rar
+Package: *General Issues
-Assigned To:
+Assigned To: cmb
[2021-11-30 16:28 UTC] cmb@php.net
-Package: *General Issues
+Package: PECL
[2021-12-01 12:13 UTC] cmb@php.net
-Assigned To: cmb
+Assigned To:
[2021-12-01 12:13 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 19:00:01 2025 UTC |
Description: ------------ Attempt to open archive with non-english (cyrilic) characters in the path results a read error: Warning: RarArchive::open(): Failed to open C:\php\папка\test.rar: ERAR_EOPEN (file open error) in C:\php\testrar.php on line 2 My attempt to replace the char* with zend_string* was unsuccessful in function PHP_FUNCTION(rar_open). Test script: --------------- This scripts get same errors: <?php // In this script i'm try to open archive, called "тест.rar" from folder "папка" (Russian Cyrilic, UTF-8 filepath in php7.1) $rar = RarArchive::open(__DIR__ .'/папка/тест.rar'); // In this moment i get "ERAR_EOPEN (file open error)" warning if(false !== $rar) { print_r($rar->getEntries()); $rar->close(); } ?> Ok. Let's try to recode path from UTF-8 to WINDOWS-1251: <?php // Recode by iconv $rar = RarArchive::open(iconv('UTF-8','WINDOWS-1251',__DIR__ .'/папка/тест.rar')); // But still have same "ERAR_EOPEN (file open error)" warning if(false !== $rar) { print_r($rar->getEntries()); $rar->close(); } ?> Expected result: ---------------- Array ( [0] => RarEntry Object ( [rarfile:RarEntry:private] => RarArchive Object ( ) [position:RarEntry:private] => 0 [name:RarEntry:private] => php.exe [unpacked_size:RarEntry:private] => 127488 [packed_size:RarEntry:private] => 45642 [host_os:RarEntry:private] => 2 [file_time:RarEntry:private] => 2017-11-23 09:56:08 [crc:RarEntry:private] => 23791171 [attr:RarEntry:private] => 32 [version:RarEntry:private] => 29 [method:RarEntry:private] => 53 [flags:RarEntry:private] => 0 [redir_type:RarEntry:private] => 0 [redir_to_directory:RarEntry:private] => [redir_target:RarEntry:private] => ) [1] => RarEntry Object ( [rarfile:RarEntry:private] => RarArchive Object ( ) [position:RarEntry:private] => 1 [name:RarEntry:private] => тест.rar [unpacked_size:RarEntry:private] => 15645 [packed_size:RarEntry:private] => 15645 [host_os:RarEntry:private] => 2 [file_time:RarEntry:private] => 2017-11-23 09:29:38 [crc:RarEntry:private] => e5f65ba2 [attr:RarEntry:private] => 32 [version:RarEntry:private] => 29 [method:RarEntry:private] => 48 [flags:RarEntry:private] => 0 [redir_type:RarEntry:private] => 0 [redir_to_directory:RarEntry:private] => [redir_target:RarEntry:private] => ) ) Actual result: -------------- Warning: RarArchive::open(): Failed to open C:\php\папка\test.rar: ERAR_EOPEN (file open error) in C:\php\testrar.php on line 2