Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Odd encoding problem in Tk app when packaged with pp

by Khen1950fx (Canon)
on Jan 27, 2013 at 22:32 UTC ( #1015591=note: print w/ replies, xml ) Need Help??


in reply to Odd encoding problem in Tk app when packaged with pp

It works for me on Linux:

#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = Tk::MainWindow->new; $mw->minsize( 300, 250 ); my $entered = "\x{171}"; open OUT, '>>', $entered; binmode OUT, ":encoding(UTF-8)"; my $entry = $mw->Entry( -textvariable => \$entered, -width => 75, -takefocus => 1, )->pack(); $entry->focus( -force ); my $go = sub { print OUT "$entered\n"; }; my $buttgo = $mw->Button( -text => "Go", -command => $go )->pack(); $mw->bind( '<Return>', $go ); my $buttexit = $mw->Button( -text => "Exit", -command => sub { exit }, )->pack(); close OUT; Tk::MainLoop();


Comment on Re: Odd encoding problem in Tk app when packaged with pp
Download Code
Replies are listed 'Best First'.
Re^2: Odd encoding problem in Tk app when packaged with pp
by elef (Friar) on Jan 28, 2013 at 10:49 UTC
    Well, it works for me on Windows, too. I'm only getting a bug when packaging the script with PAR::Packer, and even then only when typing into the box, not when copy-pasting into it or hardcoding the funky characters into the script.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015591]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2015-07-30 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls