Why Android Asset files in Visual Studio (Xamarin) lack accents?
I have a Visual Studio (Xamarin, Android) project with an accent file in the name:
diário.png
This file is located in the Assets folder and is marked as an Android object.
Unfortunately, when I build the project, I get a compilation error:
C:\Users\vchel\Documents\FlatRedBallProjects\AndroidSpecialCharacter\AndroidSpecialCharacter\obj\Debug\assets\content\gumproject\dißrio.png : error : Invalid filename. Unable to add.
Note that the file has a diário.png file in my project, but the error is referring to it as dißrio.png.
If I rename the file to diario.png (no accent over the letter a) the project is obstinate.
I know I could work around this by not using accent characters in my file, but that seems like a strange limitation. Is this a known issue? Is there any other way to solve this problem other than avoiding the use of accents in file names?
source to share
Asset naming constraints are tied down to Android API 1
related build and packaging tools .apk
(and have nothing to do with the Xamarin framework).
-
Valid characters for name resources are [az, _, 0-9]
- Lowercase letters, numbers, and the underscore
-
Use the underscore character (
_
) as a multi-name separator between words in your resources- Hyphens, spaces and periods are not allowed
-
The first letter can be either _ or a small case character
- Numbers are not allowed as the first character
Note. There used to be notes about these restrictions on the Android developer site, but I can't find them anymore as they removed most of the build tools docs.
source to share