本文共 2652 字,大约阅读时间需要 8 分钟。
本文翻译自:
Since AVD tools 16 I'm getting this warning: 自AVD工具16以来我收到此警告:
Replace "..." with ellipsis character (..., …) ?
in my strings.xml 在我的strings.xml中
at this line 在这条线上
Searching...
How do I replace ...
? 我该如何更换...
? Is it just literally …
它只是字面上的…
? ?
Could someone explain this encoding? 有人可以解释这种编码吗?
参考:
To make thing short just put …
为了简单…
只需将…
in place ... 到位 ...
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 ". 将警告级别更改为“ 信息 ”或“ 忽略 ”。
If you're using Eclipse then you can always do the following: 如果您正在使用Eclipse,那么您始终可以执行以下操作:
This should replace your three dots with the proper Unicode character for ellipsis. 这应该用省略号的正确Unicode字符替换你的三个点。
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. 请注意:最新版本的ADT(21.1)有时不能正确执行替换操作,但早期版本没有问题。
This is the character: …
这是角色: …
This answer is indirectly related to this question: 这个答案与这个问题间接相关:
In my case textView1.setTextView("done…");
在我的例子中textView1.setTextView("done…");
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. 后来,我检查了fileformat.info
中的值代表什么,我发现这是一个汉字。 So, what to do? 那么该怎么办? I searched for "fileformat.info ellipse character" and then everything became clear to me once I saw its values are; 我搜索了“fileformat.info ellipse character”,一旦我看到它的值,一切都变得清晰了;
UTF-16 (hex) 0x2026 (2026)
UTF-16 (decimal) 8,230
So, you have several encoding available to represent a character (eg 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. 因此,您可以使用多种编码来表示字符(例如,十进制中的10表示为六进制中的A),因此了解何时编写unicode字符,接收函数如何对其进行解码非常重要。 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. 在我的例子中,setTextView()函数接受十进制编码值,但我提供了十六进制值,所以我得到了错误的字符。
Android Studio中的快速修复快捷方式默认为Alt
+ Enter
。
转载地址:http://bwjnb.baihongyu.com/