Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use utf8;
- use Encode;
- use Devel::Peek;
- # Same string as you had.
- utf8::upgrade( my $string = "\x{c3}\x{a9}l\x{c3}\x{a8}ve\n" );
- { my $string = $string; Encode::_utf8_off( $string ); Dump($string); }
- { my $string = $string; utf8::encode( $string ); Dump($string); }
- __END__
- Output:
- SV = PV(0x1bc7290) at 0x1be3f98
- REFCNT = 1
- FLAGS = (POK,pPOK)
- PV = 0x1bdd440 "\303\203\302\251l\303\203\302\250ve\n"\0
- CUR = 12
- LEN = 14
- SV = PV(0x1bc72b0) at 0x1bf12f0
- REFCNT = 1
- FLAGS = (POK,IsCOW,pPOK)
- PV = 0x1ceb1c0 "\303\203\302\251l\303\203\302\250ve\n"\0
- CUR = 12
- LEN = 17
- COW_REFCNT = 1
Advertisement
Add Comment
Please, Sign In to add comment