Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Should Locale.ENGLISH be used for lowercasing file extensions? #111

Open
saket opened this issue Nov 21, 2023 · 1 comment
Open

Should Locale.ENGLISH be used for lowercasing file extensions? #111

saket opened this issue Nov 21, 2023 · 1 comment

Comments

@saket
Copy link
Contributor

saket commented Nov 21, 2023

AndroidFileSystem uses Locale.getDefault() for lowercasing file extensions. Wouldn't this generate different results on different locales? Should modernstorage use Locale.ENGLISH instead?

val mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension.lowercase(Locale.getDefault()))

@saket
Copy link
Contributor Author

saket commented Nov 21, 2023

Turns out MimeTypeMap is already calling String#toLowerCase(Locale.ROOT) internally. I'm assuming modernstorage does not need to do it again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant