Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Tk characters econdings on Wine

by IB2017 (Sexton)
on Feb 08, 2018 at 10:31 UTC ( #1208695=perlquestion: print w/replies, xml ) Need Help??
IB2017 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I have a very special problem, but maybe you can shed some light on the things I can work on to solve it.

I am in need to run a perl/tk application on Wine for macOs (the why is a long story. It actually works fine, exept for one thing which is quite strange and is someway related to Tk:

every Perl/Tk application compiled in exe I try to run in Wine on a macOS does not accept as input (in wigets Entry or Text, for example) from the keyboard fonts/languages like Russian, Arabic etc. and produces simple ?????? for any key stroke. I tried many perl/tk apps (.exe) from myself and from third parties. I thought it had to do with Wine, but here are a couple of strange things:

  • if I copy and paste text in such languages from an Internet Browser into the widgets, the fonts are displayed correctly
  • any other application which is not written in Perl/Tk works perfectly fine (even in Perl/Wx!)

One possible solution would be to compile directly in macOS or switch to Perl/Wx. But this would mean a lot of work... and someway I find this behavior quite strange and would like to understand it, and possible solve it.

I am working on a macOS HighSierra in Italian. Any suggestion what I could try/consider is appreciated.

Replies are listed 'Best First'.
Re: Tk characters econdings on Wine
by marto (Bishop) on Feb 08, 2018 at 10:46 UTC

    If you Package your script on MacOS rather than use a compatibility layer such as Wine does it work as expected? I'd advise against your current approach, it only makes problems more difficult to debug. For example, is the error in your perl code, Tk or is it side effect of the compatibility layer?

      Hi Marto. Thank you for your suggestion. However, the project is very big and packaging the script on MacOS is at the moment not an options (too many WIN32 modules, etc.). The approach works "actually" quite fine for any other aspects.

      • There is no error in my perl code. I tested it with a simple mainwindow with an entry field (packed as exe). Simple like that. As I wrote, I tried several tk applications from others, and they all have the same problem.
      • I suspect there is no bigger problem in the compatibility layer, as it works perfectly on any other (non perl/tk) application I tried. It is only with perl/tk that this appears
      • There must be some encoding issues in Tk (at least for this very particular situation), and it must have to do with some encodings. Unfortunately I do not have any clue on how to try to solve it.

        Thanks for the reply, for clarity, I wasn't suggesting that there actually was a problem with your perl code in this particular instance, just that the use of such compatibility layers will muddy the waters when it comes to trying to find the root cause of a problem. True, writing platform agnostic code is initially more work, but I would say it's easier to maintain in the long term.

Re: Tk characters econdings on Wine
by vr (Friar) on Feb 09, 2018 at 12:20 UTC

    I don't have a solution for you, but, at least, to exclude MacOs and pre-packed exe: under Ubuntu and Wine, with portable Strawberry Perl and Tk installed, entering non-Latin characters from keyboard into text widget results in '????', too.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1208695]
Approved by marto
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-02-25 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (312 votes). Check out past polls.

    Notices?