#!/usr/bin/env perl use strict; use warnings; use Encode; use Devel::Peek; my $a='AAA'; Dump($a); $a = decode('utf8',$a); Dump($a); #### > ./utf8-1.pl SV = PV(0x92a10a0) at 0x929ee10 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x92aea88 "AAA"\0 CUR = 3 LEN = 4 SV = PV(0x92a10a0) at 0x929ee10 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8) PV = 0x92f76c8 "AAA"\0 [UTF8 "AAA"] CUR = 3 LEN = 4