google / modernstorage

ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions
https://google.github.io/modernstorage/
Apache License 2.0
1.24k stars 54 forks source link

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

Open saket opened 10 months ago

saket commented 10 months ago

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

https://github.com/google/modernstorage/blob/74ffdae8638bf36930dcda3ad650da8a8c868522/storage/src/main/java/com/google/modernstorage/storage/AndroidFileSystem.kt#L206

saket commented 10 months ago

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