androidgoogle-maps-markersgoogle-maps-android-api-2non-unicode

Non-ASCII title for android map marker


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)
        );

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")

Solution

  • I found a hack that seems to work, but still waiting for a real solution.

    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")