-1

Here is my code

copy($_FILES['btnFile']['tmp_name'],"images/সাদাকালো-ছবি.jpg");

In OS windows i also tried with utf8_encode(), env() but not working only showing as follows:

সাদাকালো-ছবি.jpg

  • You will run into all sorts of OS specific issues when moving from OS to OS or version to version. Even regional settings or swapping partition types. If you still need to do this, add OS type, version, file system type and version and the PHP version to your post. It is likely you will need to submit a feature request to bugs.php.net. – oxygen May 26 '14 at 16:34
  • [Please note that utf8_encode only converts a string encoded in ISO-8859-1 to UTF-8](http://www.php.net/manual/en/function.utf8-encode.php#Hcom104906) – Rahil Wazir May 26 '14 at 16:36

1 Answers1

1

After doing some research, I got some bad news for you:

ALL php file system functions (dir, is_dir, is_file, file, filemtime, filesize, file_exists etc) only accept and return file names in ISO-8859-1, irrespective of the default_charset set in the program or ini files.

However, you can scan a dir and use it's results. But glob() will fail if the ISO representative is ambiguous. Please check this answer.

Community
  • 1
  • 1
Hannes Schneidermayer
  • 4,729
  • 2
  • 28
  • 32
  • latin1 assumption is only true for several codepages, before PHP 7.1 it's ANSI codepage that is used internally. Upgrading to 7.1 will let you use UTF-8. Thanks. – Anatol Belski Jun 23 '17 at 22:46