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()

http://php.net/manual/en/function.utf8-encode.php


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -