vnpenguin has asked for the wisdom of the Perl Monks concerning the following question:
I would like to convert all into UTF-8 characters. I'm a Perl's newbie so I try a stupid method (for NCR decimal < 255 and CER presentation only):cách bạn đặt
I'm sure that there is better way to do that. So I'm there and I would like to learn from you all. Thank you in advance,my %ARR = ( 'acirc' => 'â', 'atilde' => 'ã', 'auml' => 'ä', '226' => 'â', '227' => 'ã', '228' => 'ä' ); while(<>){ s/&#?([^;]+);/$ARR{$1}/g; print $_; } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NCR & CER to UTF-8
by Articuno (Beadle) on Nov 01, 2005 at 12:04 UTC | |
|
Re: NCR & CER to UTF-8
by theorbtwo (Prior) on Nov 01, 2005 at 14:44 UTC | |
by vnpenguin (Beadle) on Nov 01, 2005 at 15:44 UTC | |
by theorbtwo (Prior) on Nov 01, 2005 at 15:58 UTC | |
by vnpenguin (Beadle) on Nov 01, 2005 at 16:14 UTC |