Skip to content

fix: use DirectoryStream to prevent failure on invalid utf-8 filenames#32

Open
transaero21 wants to merge 1 commit intoTutorialsAndroid:masterfrom
transaero21:invalid-filename-fix
Open

fix: use DirectoryStream to prevent failure on invalid utf-8 filenames#32
transaero21 wants to merge 1 commit intoTutorialsAndroid:masterfrom
transaero21:invalid-filename-fix

Conversation

@transaero21
Copy link

You can create invalid file using touch "$(echo -e '\xEB\xEE\xE2\xE0\xF0\xE8')"
Unfortunately in Lollipop ang higher ART is used, and it can't handle some symbols - https://stackoverflow.com/a/34282026
There is not many options to read directory files, and another option only available on Oreo and higher - use DirectoryStream, which will not throw exception

You can create invalid file using `touch "$(echo -e '\xEB\xEE\xE2\xE0\xF0\xE8')"`
Unfortunately in Lollipop ang higher ART is used, and it can't handle some symbols - https://stackoverflow.com/a/34282026
There is not many options to read directory files, and another option only available on Oreo and higher - use DirectoryStream, which will not throw exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant