319
votes

Since AVD tools 16 I'm getting this warning:

Replace "..." with ellipsis character (..., …) ?

in my strings.xml

at this line

 <string name="searching">Searching...</string>

How do I replace ...? Is it just literally &#8230;?

Could someone explain this encoding?

7
As a note, I've noticed that some of Android's own translated string files use … itself rather than the Unicode entity. Given that Android XML files are normally encoded in UTF-8 anyway, I see no reason not to use the character itself rather than the potentially-esoteric Unicode entity, especially as most word processing programs these days support autocorrecting "..." to "…" (Microsoft Word does it by default, last I checked). - JAB
Is it actually three dots (ASCII 46 / 0x26)? Or ASCII 133 (one character)? - Peter Mortensen
At the answer of another SO question, there's a better explanation than 'Change ... into the Unicode because it's better'. stackoverflow.com/a/27984145/973919 In short, it prevents the three dots from being split on a multi line text (showing 1 or 2 dots alone) and in some typographies it looks bad to see 3 dots. - xarlymg89

7 Answers

552
votes

&#8230; is the unicode for "" so just replace it. It's better to have it as one char/symbol than three dots.

15
votes

To make thing short just put &#x2026; in place ...

Link to XML character Entities List

  • Look at Unicode column of HTML for row named hellip
13
votes

If you're using Eclipse then you can always do the following:

  • Right click on the warning
  • Select "Quick Fix" (shortcut is Ctrl + 1 by default)
  • Select "Replace with suggested characters"

This should replace your three dots with the proper Unicode character for ellipsis.

Just a note: The latest version of ADT (21.1) sometimes won't do the replace operation properly, but earlier versions had no problem doing this.

This is the character:

8
votes

The solution to your problem is:

Go to Window -> Preferences -> Android -> Lint Error Checking

And search for "ellipsis". Change the warning level to "Info" or "Ignore".

3
votes

This answer is indirectly related to this question:

In my case textView1.setTextView("done&#8230"); was showing some box/chinese character. Later, I checked into fileformat.info for what the value represents and I found this is a Han character. So, what to do? I searched for "fileformat.info ellipse character" and then everything became clear to me once I saw its values are;

UTF-16 (hex) 0x2026 (2026)

UTF-16 (decimal) 8,230

So, you have several encoding available to represent a character (e.g. 10 in Decimal is represented as A in hexa) so it is very important to know when you are writing an unicode character, how receiving function decodes it. If it decodes as decimal value then you have to provide decimal value, if it accept hexadecimal then you have to provide hexadecimal.

In my case, setTextView() function accepts decimal encoded value but I was providing hexadecimal values so I was getting wrong character.

3
votes

The quick fix shortcut in Android Studio is Alt + Enter by default.

0
votes

Best not to ignore it as suggested by some, it seems to me. Use Android Studio to correct it (rather than actually typing in the character code), and the tool will replace the three dots with the three-dot unicode character. Won't be confusing to translators etc.