Yii Framework Forum

Kartik Yii2 widget fileinput (no utf-8 support)


(Konstantinos Asimakopoulos) #1

I would like to upload a filename with utf-8 characters such as greek, german etc. The upload occurs successfully for both file size and type, unfortunately its filename is being replaced by strange characters. However when english characters for filename are used, there is no problem at all.

I provide you with the filename being generated for utf-8 characters

additionally i added a github issue with more tips. Any kind of idea would be convenient to me!

Regards


(keem) #2

Hey [Konstantinos], I am not an expert, but it looks like the utf-8 encoding happened two times here. I had a similar problem with a code I had. From somewhere I found something like a utf-8 negative and when I put in the corresponding symbols for the letters i needed it worked. Hope it helps you my friend.
Best regards


(Konstantinos Asimakopoulos) #3

I post you the source function that does the hard job for filename output via _slugDefault and please give me your advice step by step if possible.

Regards


(keem) #4

Hello again,
I would love to help you out mate. I am a newbie myself, thought that you had maybe a similar problem as I had. Did you try to put in the text without encoding it in utf-8?
Best regards


(Konstantinos Asimakopoulos) #5

For english characters no problem at all regarding utf-8 encoding, for other alphabets there is a problem regarding utf-8 encoding.


(keem) #6

I searched and found this in our forum


sounds similar to your problem.


(Konstantinos Asimakopoulos) #7

Yes… that actually was the solution to my problem and i thought that has to do with the widget itself.

Many many many thanks!!!