0

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?

9
  • is this in arrays.xml under /res/values? Commented May 7, 2013 at 12:40
  • @Raghunandan this can go in strings.xml under /res/values. No need for arrays.xml. Commented May 7, 2013 at 12:44
  • 1
    @TronicZomB i know i was just clarifying coz the above worked for me. I don't see a problem Commented May 7, 2013 at 12:50
  • @Raghunandan the only two things I see are the capital letter, Android complains about that sometimes when they are in xml files, and the umlaut could be a problem, but I'm not entirely sure on that one. Commented May 7, 2013 at 12:52
  • @TronicZomB it worked for me even if i had this "Gefühle_de". Commented May 7, 2013 at 12:53

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

i am very agree with what @Shemsu-Hor said, remeber be always use a standard naming rule, english is okay enough
with string gefühle_de I receive the same error, the ü is necessary because is a deutsch word, I don't know if the same thing without it
0

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.

2 Comments

Yes I've tried but doesn't work, I've followed your advice, I've remove the 'ü' character
if removing the umlaut and cleaning don't work that this is quite an interesting problem you have...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.