Fix arabic unicode block percent sign in ar.

DecimalFormatSymbols.maybeStripMarkers() tries to extract a single
relevant Unicode character (from the BMP, a.k.a a Java char) from the
String that is percentSign in CLDR.

For that purpose it tests if the character is prefixed with one of the
directionality markers. In the recent CLDR/ICU release, the percentSign
for the ar locale changed to U+066A ARABIC PERCENT SIGN followed by
U+061C ARABIC LETTER MARK.

maybeStripMarkers didn't expect the marker character to be following the
"real" character and fell back to ASCII '%'.

This change replaces the logic for the case of more than one character
to find the only non-marker character in the string and return that.

If no non-marker character, more than one non-marker character or U+0000
are encountered, then it'll fall back to the fallback.

Bug: 36562145
Test: vogar libcore.java.text.DecimalFormatSymbolsTest
Test: Checked battery status in ar locale using arabic percent sign
Change-Id: I990d3a69c6e7db61cfcf40bc6cf3a5fbf6247cad
2 files changed