MonkeyRunner を使用して Android デバイスでキリル文字を入力しようとしていますが、何も出力されないか、疑問符 ("?") 文字のみが出力されます。
コード:
print (sys.getdefaultencoding())
print (locale.getpreferredencoding())
print (sys.stdout.encoding)
次の出力を提供します。
ascii
None
Cp1251
テキストを表示するために次の方法を試しました:
device.type('Мой текст') #This code type nothing
device.type(u'Мой текст') #This code type nothing
device.type(unicode('Мой текст','cp1251')) #This code type nothing
device.type(unicode('Мой текст','cp1251').encode('utf8')) #This code type nothing
device.type(u"\u0410".encode('utf8')) #This code type ??
device.type("\xe2\x98\x83".decode('utf8')) #This code type ?
エンコード/デコード メソッドを使用する正しい方法、または を介してキリル文字を表示するその他の方法はdevice.type()
何ですか?