Android Question [Resolved] Opening image files whose names are in Cyrillic

Sergey_New

Well-Known Member
Licensed User
Longtime User
Tried with ImageView and WebView - error (file not found). The files are located in the program folder.
Tell me, please, a solution.
The programs built into the emulator and the device open these files.
 

klaus

Expert
Licensed User
Longtime User
@LucaMs Thank you for showing how to load an image in a WebView.
I tried with Sergeys' original code, which seems to be wrong.

@Sergey_New
Strange, we have no problem with Cyrillic file name, so the problem must be somewhere.
What is the targetSDKVersion in your Manifest file?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Yes, there is a problem with files in Cyrillic.
In the joint test program, I have set the RunTimePermissions.
Added the same file in DirRootExternal with two names, "Кеннеди.jpg" and "Kennedy.jpg".
Effectively, "Kennedy.jpg" is read from DirRootExternal.
"Кеннеди.jpg" throws the error but it can be read from File.DirAssets.

I am afraid that only Erel can help here.
Anyway in a near future acces to DirRootExternal will become impossible, Google restriction.
 

Attachments

  • TestImage.zip
    22.9 KB · Views: 131
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
Here's what I found:
If the file name is in lower case (кеннеди.jpg), then the image is displayed in the WebView and in ImageView, if in upper case (Кеннеди.jpg) it is not.
Changing the filename with ToLowerCase doesn't help. Only need to rename the file.
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
In my experiments, I converted the filename to lower case and this caused a mismatch. Thank you all for your time.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…