Android地图标记的非ASCII标题 [英] Non-ASCII title for android map marker
问题描述
我希望能够添加一个标题仅包含非ASCII字符的标记:
I would like to be able to add a marker with a title that has only non-ASCII characters:
marker = map.addMarker(
new MarkerOptions()
.title("אני")
.position(latlng)
);
不幸的是,该图块没有显示,只有一个空的信息窗口. 首先,我认为总体上希伯来语字符存在问题,但它们似乎没问题,因为如果标题的BEGINNING中包含ASCII文本,那么它将起作用:
Unfortunately the tile doesn't show up, only an empty info window. First I thought that there is a problem with the Hebrew characters in general, but they seem to be fine, because if there's ASCII text in the BEGINNING of the title, then it works:
.title("me אני")
但是当希伯来语开始时却不是这样:
However it doesn't when the Hebrew is in the beginning:
.title("אני me")
推荐答案
我发现了一个似乎有效的黑客工具,但仍在等待真正的解决方案.
I found a hack that seems to work, but still waiting for a real solution.
如果我在标题的前面添加了从左到右的unicode标记,则不管第一个字符是rtl还是ltr都可以使用:
If I prepend an unicode left-to-right mark to the title, it seems to work no matter if the 1st character is rtl or ltr:
.title("\u200e" + "אני me")
这篇关于Android地图标记的非ASCII标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!