I just inherited some android code and one of the first bugs I encountered was a weird EditText issue which when I type in the letters 'a' and 'e' in sequence, the EditText automatically merges them into the character 'æ'. Full xml declaration below:
<EditText
android:id="@+id/editFirstname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/profile_edittext_selector"
android:ems="10"
android:inputType="textCapSentences"
android:paddingBottom="6dp"
android:paddingLeft="15dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:textColor="#666666"
android:textColorHint="#666666"
android:textSize="12sp" >
</EditText>
I searched on the related Activity and Fragment using the xml, but I haven't found anything that can be blamed - no TextWatcher nor any routine trying to modify input or the charsequence inside the EditText. Input language is Use Default (set to English-US).
The weird thing is, the same bug is filed in the iOS version of the app (different dev, also no clue as to why it's happening).
Has anyone encountered this before?
edit: drawable declaration, as requested:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">\
<item android:drawable="@drawable/bgd_form_selected" android:state_pressed="true"/>
<item android:drawable="@drawable/bgd_form_selected" android:state_focused="true"/>
<item android:drawable="@drawable/bgd_form"/>
</selector>
edit2:
Additional info: - Happens on all test devices: gs2, gs3, xperia z, nexus 4, galaxy ace
as mentioned above: same bug filed on iOS
important: Server receives correct input when values are submitted (e.g "ae" is not transformed) (this probably narrows it down to a Display issue)
You wrote:
The weird thing is, the same bug is filed in the iOS version of the app (different dev, also no clue as to why it's happening).
So I wonder if you added a buggy version of the font Roboto to the assets of the app. It contained a wrong ligature rule wich changed "ae" to "æ":
<Lookup index="1"> <LookupType value="4"/> <LookupFlag value="0"/> <!-- SubTableCount=1 --> <LigatureSubst index="0" Format="1"> <LigatureSet glyph="a"> <Ligature components="e" glyph="ae"/> </LigatureSet> <LigatureSet glyph="f"> <Ligature components="i" glyph="fi"/> </LigatureSet> </LigatureSubst> </Lookup>
It is already fixed, so your problem might be solved by updating the Roboto font in your app's assets.
I only have knowledge in ios, no android chops, sorry... But the property of text which you are looking at here is called 'ligature'
From Wikipedia
In writing and typography, a typographic ligature occurs where two or more graphemes or letters are joined as a single glyph. Ligatures usually replace consecutive characters sharing common components and are part of a more general class of glyphs called "contextual forms", where the specific shape of a letter depends on context such as surrounding letters or proximity to the end of a line.
You might try a font which does not have the joined glyphs or there may be a property you can flip to turn ligature off for your text view in question. Interestingly
Also Wikipedia..
The character Æ – lower case æ (in ancient times named æsc) when used in the Danish, Norwegian, or Icelandic languages, or Old English, is not a typographic ligature. It is a distinct letter—a vowel—and when alphabetised, is given a different place in the alphabetic order. In modern English orthography Æ is not considered an independent letter but a spelling variant, for example: "encyclopædia" versus "encyclopaedia" or "encyclopedia". Æ comes from Mediæval Latin, where it was an optional ligature in some words, for example, "Æneas". It is still found as a variant in English and French, but the trend has recently been towards printing the A and E separately.[8] Similarly, Œ and œ, while normally printed as ligatures in French, are wrongly replaced by component letters if technical restrictions require it.
While this specific one is somehow not a ligature but a new vowel it is still generally found and governed in the ligature setting, eg in NSAttributedString in iOs you will affect this with the ligature attribute (the actual name of that enum i don't recall right now, NSAttributedString is kind of messy in that it uses different attribute names depending if you're using it with UIKit or with CoreText.) Good luck, look into the android text docs on ligature
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With