R
R
Ravenenok2015-04-22 17:51:51
Yii
Ravenenok, 2015-04-22 17:51:51

How to set up encoding when saving Cyrillic filenames in Yii2?

ActiveForm is used to upload files to the portal

<?= $form->field($modelUploadForm, 'file[]')->fileInput(['multiple'=>true])?>

When saving files to disk, Cyrillic file names are saved in a different encoding, approximately of the following form - РђРљРў_СЕНТЯР'Р Р¬_2014.doc, while the file name is stored correctly in the database.
In which direction to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2015-04-22
@Ravenenok

In the controller, you need to change the file name from cp1251 encoding to utf-8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question