Kodi Community Forum

Full Version: keyboard.getText() - Hebrew input is reversed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Im trying to add a PR for hebrew support to an addon im using.

I figured out that when I enter a search string in Hebrew - addon sees input reversed (mirrored).

"שלום" is "םולש"

that's why I can't search for anything in Hebrew. When I enter the string backward - everything works.
t's not a problem with kodi/skin encoding because other addons work fine with Hebrew on my system.

this is the code that gets input from the user but it looks similar to other working addons.

python:

keyboard = xbmc.Keyboard()
keyboard.setDefault('')
keyboard.setHeading(_('Enter search string'))
keyboard.doModal()
if keyboard.isConfirmed():
    keyword = kbd.getText()

is there any other encoding setting I miss?

Thank you
did you set the keyboard layout in kodi to hebrew?
 
Image

it works ok for me with that setting.
(2020-11-19, 19:27)ronie Wrote: [ -> ]did you set the keyboard layout in kodi to hebrew?
 
Image

it works ok for me with that setting.

Yes I did,
I guesss its related to addon specific configuration because as i said,it works on other addons
I think the problem is somewhere else.

this plugin searches other places like this:

python:

params = { 'text': keyword,
                 'done': True
               }

 
request = {'jsonrpc': '2.0',
                 'method': 'Input.SendText',
                 'params': params,
                 'id': 1
                }

maybe it gets reversed in here
It looks like this is about my add-on. Here is repository: plugin.video.united.search

The add-on uses JSON-RPC API. It's sends "Files.GetDirectory" command to any video add-on, wich support search. Here is example:
python:
request = {'jsonrpc': '2.0',
'method': 'Files.GetDirectory',
'params': {'properties': ['title', 'genre', 'year', 'rating', 'runtime', 'plot', 'file', 'art', 'sorttitle', 'originaltitle'],
'directory': directory,
'media': 'files'},
'id': 1
}
response = xbmc.executeJSONRPC(json.dumps(request))
"directory" is any path to the plugin that is responsible for the search query. For example, "plugin://plugin.video.youtube/kodion/search/input/".
Then script wait for opening of keyboard input window and sends entered early keyword using "Input.SendText" command.
Perhaps in this case Kodi ignores the keyword language or keyboard input opens in English and ignores the character order.

@tstrul, I have an idea.
Try to open Kodi input window with English keyboard. Then send text in Hebrew using the Kore remote control. Check the result.
After this repeat this actions, but with Hebrew keyboard in Kodi. Is there a difference in the executed requests?
Its not related to my keyboard i guess it really is a problem with jsonrpc InputText.
I used an ugly workaround for now:
https://github.com/vlmaksime/plugin.vide...ll/2/files