Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What characters allowed in file names on Android?

What special characters are allowed for file names on Android?

~!@#$%^&*()_+/\., 

Also, can I save file with Unicode name?

like image 938
alex2k8 Avatar asked Apr 21 '10 01:04

alex2k8


People also ask

What characters are allowed in folder names?

Characters that are valid for naming files, folders, or shortcuts include any combination of letters (A-Z) and numbers (0-9), plus the following special characters: ^ Accent circumflex (caret) & Ampersand. ' Apostrophe (single quotation mark)


2 Answers

According to wiki and assuming that you are using external data storage which has FAT32.

Allowable characters in directory entries

are

Any byte except for values 0-31, 127 (DEL) and: " * / : < > ? \ | + , . ; = [] (lowcase a-z are stored as A-Z). With VFAT LFN any Unicode except NUL

like image 20
kreker Avatar answered Oct 02 '22 06:10

kreker


  1. On Android (at least by default) the file names encoded as UTF-8.

  2. Looks like reserved file name characters depend on filesystem mounted (http://en.wikipedia.org/wiki/Filename).

I considered as reserved:

private static final String ReservedChars = "|\\?*<\":>+[]/'"; 
like image 92
alex2k8 Avatar answered Oct 02 '22 04:10

alex2k8