I am making file manager app which will allows users to create and move files. I have an issue with moving files when file name or directory name contains special character, emoji or letter not from English alphabet. But I see that there are a lot of apps which allow to create folders and files with those characters in name and move them. Why I can not do that?
I move file to folder which name is emoji. For example this code does not create an error but in the destination folder file does not apper:
try FileManager.default.moveItem(atPath: atPath, toPath: toPath)
atPath:
/var/mobile/Containers/Data/Application/99F4B9F3-6EEB-4CA6-8BFF-73E761213C08/Documents/%E2%9D%A4%EF%B8%8F/201902180150250650.pdf
toPath:
/var/mobile/Containers/Data/Application/0702B04A-BC80-451F-BF84-A668D1990BBA/Documents/%F0%9F%8E%81/201902180148461430.pdf
%F0%9F%8E%81 is the name of the folder it's "gift emoji" but I used encoding to replace emoji:
addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlPathAllowed)!
If i remove % from folder name - it's work, but after that I will not be able to convert it to original name