Thai keyboard input does not work

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
nlmarco
Level 1
Level 1
Posts: 5
Joined: Tue Apr 15, 2008 11:22 am

Thai keyboard input does not work

Post by nlmarco »

Hello *,

I'm currently migrating a friend to Kubuntu 7.10. He's forced to use a service which works with IE only (no other browser can display their website). Fortunately, IE6 works with Wine (I used ies4linux 2.99.0 to set it up), but unfortunately only with the English keyboard layout: When we switch to Thai (KDE shortcut Ctrl-Alt-K), the focused text field either does not react anymore or displays a question mark ("?") for every character (depending on which textfield it is).

IE6 renders the Thai website correctly (i.e. Thai fonts are obviously available) and typing a Thai text in another application (e.g. kwrite) and then copying it into IE6 works fine, too. Only the direct keyboard input is an issue.

I've searched a while for documentation about keyboard layouts and related settings in Wine but unfortunately didn't find anything for keywords like "keyboard", "charset" or similar. Any help would be greatly appreciated!

Best regards, Marco :-)

P.S.: "wine --version" says we're using 0.9.46 (installed with distro, i.e. apt-get).
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Thai keyboard input does not work

Post by vitamin »

nlmarco wrote:P.S.: "wine --version" says we're using 0.9.46 (installed with distro, i.e. apt-get).
That's too old - upgrade. You have to set at least LANG environment variable to the proper locale. Try:

Code: Select all

LANG=th_TH wine notepad
If that works, then configure your ie shortcut to do the same.
nlmarco
Level 1
Level 1
Posts: 5
Joined: Tue Apr 15, 2008 11:22 am

Post by nlmarco »

Thanks for the quick reply! I've upgraded to version 0.9.59 (great that you have an Ubuntu repository!!!), but unfortunately it still doesn't work (same as before: input either completely ignored or question marks).

Actually, the IE6 now works even worse :-( With the older Wine version, I was able to navigate to http://www.nightlabs.de - now it crashes and hangs up Wine completely (I have to kill -9 both IEXPLORE.EXE and wineserver). You find a log here: http://www.nightlabs.de/~marco/wine/200 ... 4linux.txt

...hmmm... very weird. It seems to be a Heisenbug: I just tried it again and now the site loads - still getting a "Backtrace" logged though and it hangs up when I close the IE (have to kill -9 IEXPLORE.EXE and wineserver, Ctrl-C doesn't work). Here's the log of this situation: http://www.nightlabs.de/~marco/wine/200 ... n_exit.txt

I don't really understand, though, why I should set the LANG environment variable (of course I tried it but it doesn't change anything). Note, that I don't want the applications (e.g. IE) to talk Thai with me, but I want to input Thai characters. And I need to be able to switch keyboard layouts on the fly, since e.g. URLs, logins etc. need to be entered using Latin characters. Additionally, Thai texts are usually mixed and contain both Thai and Latin characters (e.g. product names) in the same document.

You can switch layouts in both Windows and KDE usually back and forth with either a Shortcut (in KDE it's usually Ctrl-Alt-K, in Windows Shift-Alt) or a click on the appropriate symbol in the click start bar. As far as I understand it, this simply changes the key codes that are passed to the applications. It does not change the whole environment, but affects only the input - and that's what I want. But I assume that Wine doesn't know what to do with the Thai key codes when I switch KDE's keyboard layout... maybe I somehow have to register a key-map in Wine?

Best regards, Marco :-)
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

nlmarco wrote:Note, that I don't want the applications (e.g. IE) to talk Thai with me, but I want to input Thai characters.
For that you have to specify correct LANG environment variable as stated above. If you don't know where to do that, add this to your ~/.bashrc and reboot:

Code: Select all

export LANG=th_TH
nlmarco
Level 1
Level 1
Posts: 5
Joined: Tue Apr 15, 2008 11:22 am

Post by nlmarco »

Thanks for the hint, but of course I know how to set an environment variable and (as stated in my previous posting) I already tried it without any effect.

So to be more precise, here's what I did:

Start IE with KDE's keyboard layout set to English and using the following command in a shell:

Code: Select all

chuchart@meru:~$ set | grep LANG ; export LANG=th_TH ; set | grep LANG ; export WINEPREFIX="/home/chuchart/.ies4linux/ie6" ; wine "/home/chuchart/.ies4linux/ie6/drive_c/Program Files/Internet Explorer/IEXPLORE.EXE"
LANG=en_US.UTF-8
LANG=th_TH
_=LANG
err:service:RPC_MainLoop RpcServerUseProtseq failed with error 1703
err:wineboot:start_services_process Unexpected termination of services.exe - exit code 1703
err:shell:ReadCabinetState Initializing shell cabinet settings
fixme:shell:DllGetClassObject failed for CLSID=
        {53bd6b4e-3780-4693-afc3-7161c2f3ee9c} (MruLongList)
err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=71180f00
...
...
...
As you can see, it switched the LANG environment variable from en_US.UTF-8 to th_TH (btw. I tried it with th_TH.UTF-8 and th_TH.TIS-620 as well and the result was always the same).

When I now typed sth., the Latin letters were written correctly into the text field (of the ies4linux website's donation form). So I pressed Ctrl-Alt-K to switch to Thai and tried to continue writing => no more character appeared in the text field.

Then I closed the IE, issued some kill -9 (after ps aux | grep IE and ps aux | grep wine) and tried it again - this time with having set my KDE's keyboard layout selector to Thai already when starting the IE. When the website was loaded, I clicked into the text field and started typing => No character appeared in the text field. So I pressed Ctrl-Alt-K and continued typing => Latin letters occured.

Finally, I thought I'll give notepad a try and did the same again with notepad instead of IE => Same result - i.e. no character occuring when having the Thai keyboard layout selected; Latin characters occuring when using the English layout.
nlmarco
Level 1
Level 1
Posts: 5
Joined: Tue Apr 15, 2008 11:22 am

Post by nlmarco »

Btw. vitamin, you didn't clarify why the LANG environment variable has any effect on the keyboard layout. IMHO it should not have any effect, but it should solely specify what language an application uses in its UI. If the LANG variable controlled the keyboard layout, switching on-the-fly between multiple keyboard layouts would not be possible, since you cannot change an environment variable for an application while the application is running.
Tom Evans

Thai keyboard input does not work

Post by Tom Evans »

On Wed, 2008-04-16 at 09:09 -0500, nlmarco wrote:
Btw. vitamin, you didn't clarify why the LANG environment variable has any
effect on the keyboard layout. IMHO it should not have any effect, but it
should solely specify what language an application uses in its UI. If the
LANG variable controlled the keyboard layout, switching on-the-fly between
multiple keyboard layouts would not be possible, since you cannot change
an environment variable for an application while the application is running.
Of course you can.

man 3 setenv

But more seriously, isn't the issue not the language the UI appears in,
but what input method is being used, and that choice is down to X11 I
think, not WINE. Certainly, adding a Thai keyboard layout to GNOME
(System --> Preferences -> Keyboard -> Layouts), and setting a key to
switch between the layouts (defaults to both alt keys IIRC) worked to
enter 'some sort of unicode' into notepad running under wine. I have no
East Asian fonts installed here (certainly not under wine), so that
would explain the missing characters - they appeared simply as the
windows "character I don't have glyphs for" glyph. YMMV.

Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.winehq.org/pipermail/wine-us ... chment.pgp
nlmarco
Level 1
Level 1
Posts: 5
Joined: Tue Apr 15, 2008 11:22 am

Post by nlmarco »

Hello Tom,

thanks for giving it a try! It's good to read that it works on your machine. Maybe Wine works better with GNOME than with KDE. I don't get "character I don't have glyphs for"-glyphs - my key strokes are simply totally ignored when I switch to the Thai keyboard layout.

As already mentioned, writing a Thai/Latin mixed text in kwrite (KDE's simple text editor) and then copy'n'pasting it into a text field of a web site works fine.

However, I saw that when I paste a Thai text from the clipboard into IE's address field (not a web site's text field) or into notepad, it shows these squares ("character I don't have glyphs for"-glyphs).

Note, that I didn't install any fonts at all. My Kubuntu was capable of working with Thai even without installing anything - adding the keyboard layout in the configuration was all that's necessary for my (non-Wine) applications.

Best regards, Marco :-)
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

nlmarco wrote:It's good to read that it works on your machine. Maybe Wine works better with GNOME than with KDE.
Can you try with Wine's own notepad? If that works for you then this is not bug in Wine but ies4linux as they replace major parts of Wine with who knows what parts of IE.
C. Wizard
Level 2
Level 2
Posts: 18
Joined: Wed Apr 23, 2008 1:24 pm

Re: Thai keyboard input does not work

Post by C. Wizard »

nlmarco wrote:I'm currently migrating a friend to Kubuntu 7.10. He's forced to use a service which works with IE only (no other browser can display their website)....
Really?! I've never encountered such a site.
Can you give me the URL, by PM, if necessary and let me try it.
Thanks.
Locked