Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can input only latin letters when XIM used gtk input module #143

Closed
375gnu opened this issue Feb 3, 2015 · 7 comments
Closed

Can input only latin letters when XIM used gtk input module #143

375gnu opened this issue Feb 3, 2015 · 7 comments

Comments

@375gnu
Copy link

375gnu commented Feb 3, 2015

Starting with version 1.6 of poedit I can't enter non-latin letters inside it
when gtk input method is XIM. When I set it into "None" from contex menu in
editable area poedit accepts non-latin letter. Other WX based applications like
Audacity or XCHM work as expected.

@vslavik
Copy link
Owner

vslavik commented Feb 3, 2015

I have no idea what the "XIM input method" is, nor how would I use it (it doesn't help that you failed to mention such as details as wx or GTK+ version and was extremely vague about the exact specific version of Poedit you actually did test).

You on the other hand do, and can reproduce it, so please debug it a bit and provide a patch — or at least a more technical, detailed and reproducible description that I can do something about.

@375gnu
Copy link
Author

375gnu commented Feb 3, 2015

My current poedit version is 1.7.4, but this issue was in 1.6 branch too. My OS is Debian GNU/Linux "Sid".

WX/GTK versions: libwxbase3.0-0, libwxgtk3.0-0 — 3.0.2-1+b1; libgtk-3-0 — 3.14.5-1.

The X Input Method (XIM) is the original input method framework for the X Window System. You can use as "GTK_IM_MODULE=xim poedit" then try to enter something outside ASCII,

@vslavik
Copy link
Owner

vslavik commented Feb 3, 2015

GTK_IM_MODULE=xim poedit

Sounds like something obscure that no normal person would use, then, doesn't it? Is there any legitimate (i.e. not "I'm used to it", "I don't like it" and such) reason not to use the default IBus method?

You also neglected to mention that this results in WARNING **: Error converting text from IM to UTF-8: Invalid byte sequence in conversion input messages on the console and quick search for that shows that it isn't Poedit or wx specific and seems related to locale — i.e. the XIM method is broken and doesn't work correctly if the application runs under the "C" locale. That would be consistent with the 1.6 timeline.

Oh well, it's locale time. This hotfix (read: improper gross hack) patch fixes it:

diff --git a/src/edapp.cpp b/src/edapp.cpp
index 0c64527..6f8963d 100644
--- a/src/edapp.cpp
+++ b/src/edapp.cpp
@@ -340,6 +340,8 @@ void PoeditApp::SetupLanguage()
     trans->AddStdCatalog();
     trans->AddCatalog("poedit");

+    setlocale(LC_ALL, "");
+
     wxString bestTrans = trans->GetBestTranslation("poedit");
     Language uiLang = Language::TryParse(bestTrans.ToStdWstring());
     UErrorCode err = U_ZERO_ERROR;

@LocutusOfBorg
Copy link
Contributor

Hi @vslavik do you think this "fix" will go on the next release or should debian apply it?

I'm inclined to wait for the new release (if you want to push this workaround on master) since we are on release-freeze

let me know,

thanks :)

@vslavik
Copy link
Owner

vslavik commented Feb 3, 2015

Hi @vslavik do you think this "fix" will go on the next release or should debian apply it?

No and no. The proper way is to use wxLocale for this — I'll push a fix to that affect to the maint-1.7 branch soon.

@LocutusOfBorg
Copy link
Contributor

thanks! so I'll keep following your changes then :)

@375gnu
Copy link
Author

375gnu commented Feb 3, 2015

Sounds like something obscure that no normal person would use, then, doesn't it? Is there any legitimate (i.e. not "I'm used to it", "I don't like it" and such) reason not to use the default IBus method?

It's the simplest method to use XCompose.

You also neglected to mention that this results in WARNING **: Error converting text from IM to UTF-8: Invalid byte sequence in conversion input messages on the console

I don't run poedit from console, so I never saw that message.

Anyway you hotfix works.

vslavik added a commit that referenced this issue Feb 4, 2015
XIM input method and probably other things (standard dialogs?) don't
work correctly if the locale isn't set under GTK+/X11/Unix.

Revert to using wxLocale again, albeit only under wxGTK for now.
Eventually, this change should propagate to all platforms.

Fixes #143.
@vslavik vslavik closed this as completed Feb 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants