T
T
TheShestov2015-10-21 17:43:14
PHP
TheShestov, 2015-10-21 17:43:14

Russian file names on the web server?

Hello!
I deployed LAMP on my ubuntu server - wordpress is on it.
When uploading media files with Russian names, they are successfully uploaded and displayed, but on the server in the names of krakozyabry: /2015-05-06-12-37-53-Рабочий-стоР".png
Prompt how to fix ?
charset.conf in /etc/apache2/conf-enabled and conf-available added: AddDefaultCharset UTF-8
to php.ini where possible - changed to UTF-8 - but no use.
Thank you!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
W
WP Panda, 2015-10-22
@TheShestov

File names in Cyrillic are bad, even if everything works wonderfully on a specific one, there is a non-sour chance that they will crash during transfer.
Connect any transliteration and hang on sanitize_file_name
after that, the file will be processed by it during loading and change the name to a name in Latin

M
Mikhail Osher, 2015-10-21
@miraage

This is bad manners. It is not necessary to either download Russian names or store them.
When uploading files, rename to Latin.
// UPD
Rename already using PHP on the server, and put instead of 2015-10-09_na_more.jpg 2015-10-09_na_more.jpg.

D
dk-web, 2015-10-21
@dk-web

Just recently asked.
Does it make sense to leave files in Cyrillic when uploading to the server?

I
Ilya Beloborodov, 2015-10-22
@kowap

Google doesn't like pictures whose names are in Cyrillic

I
itacademy, 2020-02-29
@itacademy

I do not agree that Google does not like Cyrillic. He loves her very much and there will be more traffic.
I agree that there may be problems with incorrect hosting settings. If not all mods are installed.
But if it is necessary to open the Cyrillic alphabet on the open server, then by welcome. Convert win1251 to UTF-8 and output.
<?
echo iconv('windows-1251', 'UTF-8', $FILE1251);
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question