utf 8 - Yii2 FileHelper::findFiles() - error with non-ASCII characters -
i'm developing app yii2-advanced-app.
in controller (documentcontroller) read out files in directory filehelper::findfiles().
it's working, if filename contains non-ascii characters (like german umlauts, äöü) question mark in returning file-path.
how solve this? can't find suitable answer.
as web server i'm using iis 7 on windows server 2008 r2 enterprise.
documentcontroller.php
use yii\helpers\filehelper; $data = filehelper::findfiles($folderpath,['except'=>['*.db']]); var_dump($data);
the result is:
array(1) { [0]=> string(84) "c:\websites\dev.point-s.de\space/space_attachments/10082\aushang 201501 gr�ndung.pdf" }
the output should done following code, think problem reading of files.
html::a($model['name'], ['document/download', 'file' => $model['name']])
ok @ineersa trying help, got answer coworker.
the solution explicit convert filename returned findfiles() utf-8 php function utf8_encode()
Comments
Post a Comment