On Tue Nov 07 13:48:56 2017, SREZIC wrote:
Show quoted text> On 2017-11-07 10:18:00, TONKIN wrote:
> > Hi,
> >
> > Tk raises a fatal exception when handed a (very) high unicode
> > character. Here is a test script demonstrating the issue:
> >
> > #############################
> > use strict; use warnings; use feature qw/ say /;
> > binmode STDOUT, ':utf8';
> > use Try::Tiny;
> > use Tk;
> >
> > my @tests = ("\x{1f596}", "\x{04e7}");
> > my $mw = tkinit;
> >
> > for my $char ( @tests ) {
> > say "Testing with $char";
> > my $mw = tkinit;
> > my $t = $mw->Text->pack;
> > $t->insert("end", $char);
> > $t->markSet('insert','end');
> > $t->focusForce;
> > try {
> > $t->update;
> > say "Updated OK";
> > } catch {
> > say "Caught fatal exception: $_";
> > };
> > $t->destroy;
> > }
> >
> > __END__
> > #####################
> >
> > Output:
> > $ perl ~/dev/tk.pl
> >
> > Testing with 🖖
> > UCS-2BE:code point "\x{1f596}" too high at /home/nick/dev/tk.pl line
> > 13.
> > UCS-2BE:code point "\x{1f596}" too high at /home/nick/dev/tk.pl line
> > 13.
> > Caught fatal exception: UCS-2BE:code point "\x{1f596}" too high at
> > /home/nick/dev/tk.pl line 13.
> >
> > Testing with Ó§
> > Updated OK
>
> Can you give me more information on the environment (OS, perl version,
> Tk version, locale environment variables, maybe else...)? It does not
> fail for me on a debian/jessie and freebsd9 machine. It does fail on a
> Windows machine, though the error message is different:
>
> UCS-2LE:code point "\x{1f596}" too high at tk.pl line 31.
>
> And given your error message is using forward slashes I think your
> system is not Windows...
That's right :-)
I'm on Ubuntu Xenial:
$ uname -a
Linux yoda 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
$perl -V
Summary of my perl5 (revision 5 version 26 subversion 1) configuration:
Platform:
osname=linux
osvers=4.10.0-35-generic
archname=x86_64-linux
uname='linux yoda 4.10.0-35-generic #39~16.04.1-ubuntu smp wed sep 13 09:02:42 utc 2017 x86_64 x86_64 x86_64 gnulinux '
config_args='-de -Dprefix=/home/nick/perl5/perlbrew/perls/perl-5.26.1 -Aeval:scriptdir=/home/nick/perl5/perlbrew/perls/perl-5.26.1/bin'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
optimize='-O2'
cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='5.4.0 20160609'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.23.so
so=so
useshrplib=false
libperl=libperl.a
gnulibc_version='2.23'
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=so
d_dlsymun=undef
ccdlflags='-Wl,-E'
cccdlflags='-fPIC'
lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Locally applied patches:
Devel::PatchPerl 1.48
Built under linux
Compiled at Oct 4 2017 08:33:06
%ENV:
PERLBREW_BASHRC_VERSION="0.80"
PERLBREW_HOME="/home/nick/.perlbrew"
PERLBREW_MANPATH="/home/nick/perl5/perlbrew/perls/perl-5.26.1/man"
PERLBREW_PATH="/home/nick/perl5/perlbrew/bin:/home/nick/perl5/perlbrew/perls/perl-5.26.1/bin"
PERLBREW_PERL="perl-5.26.1"
PERLBREW_ROOT="/home/nick/perl5/perlbrew"
PERLBREW_VERSION="0.80"
PERL_CPANM_OPT=" --mirror cpan.mirror.constant.com --mirror cpan.hoovism-http.com --mirror
http://ftp.wayne.edu/cpan/ --mirror ftp://mirror.cogentco.com/pub/CPAN/ --mirror ftp://mirror.cc.columbia.edu/pub/software/cpan/ --mirror
http://develooper.com --mirror
http://cpan.cse.msu.edu/ --mirror
http://mirror.cc.columbia.edu/pub/software/cpan/ --mirror
http://www.cpan.org/ --mirror
http://cpan.perlnow.com/ --mirror
http://cpan.mirror.facebook.net/ --mirror
http://www.perl.com/CPAN/ --mirror
http://cpan.pair.com/ --mirror
http://mirror.uta.edu/CPAN/ --mirror
http://cpan.cs.utah.edu/ --mirror-only --cascade-search"
@INC:
/home/nick/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux
/home/nick/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
/home/nick/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux
/home/nick/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1