Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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
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 drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-10-01 16:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (29 votes), past polls