在EditText中输入"ae"会自动变为æ

jos*_*hus 6 android special-characters ios android-edittext

我只是继承了一些android代码,我遇到的第一个错误之一是一个奇怪的EditText问题,当我按顺序键入字母'a'和'e'时,EditText会自动将它们合并到字符'æ'中.完整的xml声明如下:

<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>
Run Code Online (Sandbox Code Playgroud)

我使用xml搜索了相关的Activity和Fragment,但我没有找到任何可以归咎的东西 - 没有TextWatcher,也没有任何例程试图修改EditText中的输入或charsequence.输入语言为"使用默认值"(设置为英语 - 美国).

奇怪的是,在iOS版本的应用程序中存在相同的错误(不同的开发人员,也不知道为什么会发生这种情况).

有没有人遇到过这个?

编辑:可绘制的声明,根据要求:

<?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>
Run Code Online (Sandbox Code Playgroud)

EDIT2:

附加信息: - 适用于所有测试设备:gs2,gs3,xperia z,nexus 4,galaxy ace

  • 如上所述:iOS上提交的相同错误

  • important:服务器在提交值时接收到正确的输入(例如"ae"未转换)(这可能会缩小到显示问题)

Har*_*ger 5

你写了:

奇怪的是,在应用程序的 iOS 版本中提交了相同的错误(不同的开发人员,也不知道为什么会发生这种情况)。

所以我想知道您是否在应用程序的资产中添加了字体 Roboto错误版本。它包含一个错误的连字规则,将“ae”更改为“æ”:

  <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>
Run Code Online (Sandbox Code Playgroud)

它已经修复,因此您的问题可能会通过更新应用程序资产中的 Roboto 字体来解决。