Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: pack mangles utf output

by roho (Abbot)
on Aug 28, 2013 at 15:29 UTC ( #1051297=note: print w/ replies, xml ) Need Help??

in reply to Re: pack mangles utf output
in thread pack mangles utf output

Hmmm ... I converted the utf character to hex in both output lines and here's what I got:
without pack: e28093
with pack: c3a2c280c293

Could be my version of Perl (5.89) or my platform (Windows 7), but it is not working for me.

"Its not how hard you work, its how much you get done."

Comment on Re^2: pack mangles utf output
Replies are listed 'Best First'.
Re^3: pack mangles utf output
by vsespb (Chaplain) on Aug 28, 2013 at 15:50 UTC
    Yep, perl-5.8.9 under Linux affected
    $ perlbrew exec --with perl-5.8.9 perl -MDevel::Peek -e 'use utf8; Dump pack 'A20', "FREIGHT  INTRASTATE"'
    SV = PV(0x1d14100) at 0x1d11350
      REFCNT = 1
      PV = 0x1d69870 "FREIGHT \342\200\223 INTRASTA"\0
      CUR = 20
      LEN = 32
    $ perlbrew exec --with perl-5.10.0 perl -MDevel::Peek -e 'use utf8; Dump pack 'A20', "FREIGHT  INTRASTATE"'
    SV = PV(0x1773098) at 0x178e288
      REFCNT = 1
      PV = 0x1798ca0 "FREIGHT \342\200\223 INTRASTATE"\0 UTF8 "FREIGHT \x{2013} INTRASTATE"
      CUR = 22
      LEN = 32

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2016-02-07 23:02 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (264 votes), past polls