Jump to content


Photo

VirtualKeyBoard.py


  • Please log in to reply
35 replies to this topic

Re: VirtualKeyBoard.py #21 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 10:02

To ignore the characters that are not supported by utf-8 is an easy fix....

 

kwargs["text"] = kwargs.get("text", "").decode("utf-8", "ignore")

(line 74 in VirtualKeyBoard.py)

 

then I suggest also line 528 in ChannelSelection.py can be removed.


Edited by littlesat, 31 October 2013 - 10:06.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #22 Dimitrij

  • PLi® Core member
  • 9,993 posts

+338
Excellent

Posted 31 October 2013 - 10:32

To ignore the characters that are not supported by utf-8 is an easy fix....

 

kwargs["text"] = kwargs.get("text", "").decode("utf-8", "ignore")

(line 74 in VirtualKeyBoard.py)

 

then I suggest also line 528 in ChannelSelection.py can be removed.

+

	def okClicked(self):
		self.smsChar = None
		text = (self.shiftMode and self.shiftkeys_list or self.keys_list)[self.selectedKey / 12][self.selectedKey % 12].encode("UTF-8")

+		prev_text = self["text"].getText()
+		self["text"].setText(prev_text)

		if text == "EXIT":

for self.keys_list(characters)


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: VirtualKeyBoard.py #23 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 11:02

?????

Whi should rewriting the full string help????

Sorry I do not understand this?

 

+        self["text"] = setText(self["text"].getText())
 


Edited by littlesat, 31 October 2013 - 11:03.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #24 Dimitrij

  • PLi® Core member
  • 9,993 posts

+338
Excellent

Posted 31 October 2013 - 13:49

	elif self.lang == 'ru_RU':
self.keys_list = [
[u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
[u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"+"],
[u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"#"],
[u"<", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u",", ".", u"-", u"ALL"],
[u"SHIFT", u"SPACE", u"@", u"��", u"��", u"��", u"OK", u"LEFT", u"RIGHT"]]
self.shiftkeys_list = [
[u"EXIT", u"!", u'"', u"��", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
[u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"I", u"��", u"*"],
[u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u"'"],
[u">", u"��", u"��", u"��", u"��", u"��", u"��", u"��", u";", u":", u"_", u"CLEAR"],
[u"SHIFT", u"SPACE", u"?", u"\\", u"��", u"��", u"��", u"��", u"OK", u"LEFT", u"RIGHT"]]
self.nextLang = 'sv_SE' 

not decode utf-8


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: VirtualKeyBoard.py #25 ims

  • PLi® Core member
  • 13,623 posts

+212
Excellent

Posted 31 October 2013 - 14:12

To ignore the characters that are not supported by utf-8 is an easy fix....

 

kwargs["text"] = kwargs.get("text", "").decode("utf-8", "ignore")

(line 74 in VirtualKeyBoard.py)

 

then I suggest also line 528 in ChannelSelection.py can be removed.

could it be way there ad some conversion tables for this nat chars ? I think, under E1 was not this problem... may be, it is my mistake.


Kdo nic nedělá, nic nezkazí!

Re: VirtualKeyBoard.py #26 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 14:27

I suggest that such table must know the language aswell and this is not possible...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #27 ims

  • PLi® Core member
  • 13,623 posts

+212
Excellent

Posted 31 October 2013 - 14:40

About filenames, there it is CP1250 to UTF-8 in my case. Table is defined by used language...  Or is some way for conversion names in cp1250, when are file copied to box ?


Kdo nic nedělá, nic nezkazí!

Re: VirtualKeyBoard.py #28 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 15:58

This is not done... as the provider sets the channel name and you cannot know it what format it might come.... This is not depended on the language the user set's it's box in...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #29 ims

  • PLi® Core member
  • 13,623 posts

+212
Excellent

Posted 31 October 2013 - 16:00

yes, it I know. I am talking about filenames stored into box from win pc's now


Kdo nic nedělá, nic nezkazí!

Re: VirtualKeyBoard.py #30 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 16:31

It can be considered to do something like this

 

http://gomputor.word...ng-with-python/


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #31 Dimitrij

  • PLi® Core member
  • 9,993 posts

+338
Excellent

Posted 31 October 2013 - 17:54

?????

Whi should rewriting the full string help????

Sorry I do not understand this?

 

+        self["text"] = setText(self["text"].getText())
 

 

Traceback (most recent call last):
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 66, in action
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 46, in action
  File "/usr/lib/enigma2/python/Screens/VirtualKeyBoard.py", line 324, in okClicked
    self["text"].char(text)
  File "/usr/lib/enigma2/python/Components/Input.py", line 259, in char
  File "/usr/lib/enigma2/python/Components/Input.py", line 58, in update
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 0: invalid continuation byte

use new VirtualKeyBoard.py http://sourceforge.n...2293592da48bb5/

 

You can easily check it.

 

example:

open VirtualKeyBoard,e.g. ChannelSelection ->rename entry
Delete all service name.
S
et ru lang-->key yellow.

Write a new name


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: VirtualKeyBoard.py #32 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 17:56

I do not understand how rewriting the string in input might fix it....???????

 

And based on your reply it is still not clear is it fixed for you or not....????


Edited by littlesat, 31 October 2013 - 18:00.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #33 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 18:02

This is what has been done in Input.py

 

 def setText(self, text):
  if not len(text):
   self.currPos = 0
   self.Text = u""
  else:
   try:
    self.Text = text.decode("utf-8")
   except UnicodeDecodeError:
    print "utf8 kaputt!"
    self.Text = text
  self.update()
 def getText(self):
  return self.Text.encode("utf-8")

......utf8 kaputt!


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VirtualKeyBoard.py #34 Dimitrij

  • PLi® Core member
  • 9,993 posts

+338
Excellent

Posted 31 October 2013 - 18:21

I do not understand how rewriting the string in input might fix it....???????

 

And based on your reply it is still not clear is it fixed for you or not....????

I do not understand this, but ...
it works

And based on your reply it is still not clear is it fixed for you or not....????

yes,fixed


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: VirtualKeyBoard.py #35 westsib

  • Senior Member
  • 52 posts

+2
Neutral

Posted 31 October 2013 - 19:17

I just tried to rename a sender of "Channel Selection" and get GS.

Traceback (most recent call last):
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 66, in action
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 46, in action
  File "/usr/lib/enigma2/python/Screens/VirtualKeyBoard.py", line 324, in okClicked
  File "/usr/lib/enigma2/python/Components/Input.py", line 259, in char
  File "/usr/lib/enigma2/python/Components/Input.py", line 58, in update
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 0: invalid continuation byte
(PyObject_CallObject(<bound method NumberActionMap.action of <Components.ActionMap.NumberActionMap instance at 0x24968c8>>,('OkCancelActions', 'ok')) failed)
main thread is non-idle! display spinner!
getResolvedKey config.plugins.crashlogautosubmit.sendAnonCrashlog failed !! (Typo??)
getResolvedKey config.plugins.crashlogautosubmit.addNetwork failed !! (Typo??)
getResolvedKey config.plugins.crashlogautosubmit.addWlan failed !! (Typo??)
]]>
 

yes incidentally I forgot. I've Vu Duo with 4.0


Edited by westsib, 31 October 2013 - 19:21.


Re: VirtualKeyBoard.py #36 littlesat

  • PLi® Core member
  • 56,260 posts

+691
Excellent

Posted 31 October 2013 - 19:33

Should be fixed tomorrow....


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users