CodeIgniter Forums
can't upload this image with utf8 characters and problem with json_encode - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: can't upload this image with utf8 characters and problem with json_encode (/showthread.php?tid=68345)



can't upload this image with utf8 characters and problem with json_encode - GoldenFingers - 06-27-2017

hi , guys 

i can't upload this image in the attachment
because it's contain utf8 characters

this is result

 
PHP Code:
 [raw_name] => ٢�_١٥١١�_٥_١٤٤٧٣٣_(2)7
    
[orig_name] => ٢�_١٥١١�_٥_١٤٤٧٣٣_(2).jpg
    
[client_name] => ٢٠١٥١١٠٥_١٤٤٧٣٣ (2).jpg 
 
and this file name after upload 
ظ¢ظ_ظ،ظ¥ظ،ظ،ظ_ظ¥_ظ،ظ¤ظ¤ظ§ظ£ظ£_(2).jpg

and i can't use this result in json with JSON_UNESCAPED_UNICODE flag


Any suggestion  Sad Sad


RE: can't upload this image with utf8 characters and problem with json_encode - rtenny - 06-27-2017

(06-27-2017, 01:03 AM)GoldenFingers Wrote: hi , guys 

i can't upload this image in the attachment
because it's contain utf8 characters

this is result

 
PHP Code:
 [raw_name] => ٢�_١٥١١�_٥_١٤٤٧٣٣_(2)7
    
[orig_name] => ٢�_١٥١١�_٥_١٤٤٧٣٣_(2).jpg
    
[client_name] => ٢٠١٥١١٠٥_١٤٤٧٣٣ (2).jpg 
 
and this file name after upload 
ظ¢ظ_ظ،ظ¥ظ،ظ،ظ_ظ¥_ظ،ظ¤ظ¤ظ§ظ£ظ£_(2).jpg

and i can't use this result in json with JSON_UNESCAPED_UNICODE flag


Any suggestion  Sad Sad

Do you need to retain the file name? Maybe you could save it using a random file name rather then the original name?


RE: can't upload this image with utf8 characters and problem with json_encode - GoldenFingers - 06-28-2017

is there any way to save the original name ?