diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | genhdlist2 | 17 |
2 files changed, 13 insertions, 8 deletions
@@ -1,3 +1,7 @@ +- genhdlist2: + o use utf8:: functions instead of Encode + (to be able to work with only perl base modules) + Version 5.4 - 26 February 2008, by Pascal "Pixel" Rigaux - parsehdlist, rpm2header: @@ -5,7 +5,6 @@ use URPM; use MDV::Packdrakeng; use Getopt::Long; -use Encode; main(); @@ -237,14 +236,16 @@ sub close_xml { } sub ensure_utf8 { - my ($s) = @_; - - Encode::_utf8_on($s); #- this is done on the copy - if (!Encode::is_utf8($s, 1)) { - Encode::_utf8_off($_[0]); - Encode::from_to($_[0], 'iso-8859-15', 'utf8'); + if (utf8::is_utf8($_[0])) { + utf8::valid($_[0]) and return; + + utf8::encode($_[0]); #- disable utf8 flag + utf8::upgrade($_[0]); + } else { + utf8::decode($_[0]); #- try to set utf8 flag + utf8::valid($_[0]) and return; + warn "do not know what to with $_[0]\n"; } - Encode::_utf8_on($_[0]); #- now we know it is valid utf8 } sub encode_xml { |