简体   繁体   中英

android resources string-array “invalid character”

In resource array-string I've put:

<string-array name="Gefühle_de">
<item>xxx</item>
</string-array>

But I received the error as Invalid character on Gefühle (this is a deutsch language). How to resolve the problem?

I think the issue is the uppercase G, for the string-array name.

Must be :

<string-array name="gefühle_de">
<item>xxx</item>
</string-array>

Edit : Do you really need the 'ü' char for the name, 'u' is not enough?

The best practice is to avoid uppercase, and accent chars for the tag names.

I would assume that the base Androind can't not recognize the Umlaut on the "u" within the name attribute. Try to set as name="gefuhle_de" .

EDIT: When I put the original value with the umlaut into my strings.xml, this is what my R.java came out as:

public final class R {
public static final class array {
    public static final int Gefühle_de=0x7f070001;
    public static final int spin=0x7f070000;
}

It is producing an error on the fractional character (5th one from the left). This seems to indicate that the umlaut is causing the problem. Try to remove the umlaut, lower case the "G" (not necessary in my case actually), and then clean your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM