When using TextView, The ellipsis is automatically displayed if the length is too long. native support is available in android, which is defined as follows:
Copy codeThe Code is as follows: <TextView...
Android: ellipsize = "end"
Android: singleLine = "true"/>
It can be used at first glance, but after careful observation, it is found that the ellipsis... There is a box behind it, similar to the garbled characters. Why?
When ellipsize in android was used to process strings, if it was found that the string was too long, it would replace the last character ..., It is not three vertices, but the ellipsis embedded in the font. No matter what font is used, you must support this ellipsis to display it correctly. The font used by the APP is Mercedes, which supports ellipsis display. There is no problem here. The problem is that when android processes ellipsize, it replaces a character ..., Replace the remaining truncated characters with the Unicode Character "zero width no-break space" (U + FEFF), which is not displayed on the screen, but it is still part of the string.
The problem originally exists here. The Mercedes font used does not support the display of this special character U + FEFF, so garbled characters will appear. The solution is also very simple. Edit the font file and set the width of the U + FEFF character to 0.