From: Philip Newton Date: Mon, 1 Apr 2002 08:12:01 +0000 (+0200) Subject: Re: Change 15637: Behaviour (make viacode 0xFFFE to return BYTE ORDER MARK, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7d589a8376c6fa7c8513aadcc026a8b6d244543;p=p5sagit%2Fp5-mst-13.2.git Re: Change 15637: Behaviour (make viacode 0xFFFE to return BYTE ORDER MARK, Message-ID: <63ufauo0nrvcgmj6o3u1fjaf1t787a5l1n@4ax.com> p4raw-id: //depot/perl@15654 --- diff --git a/lib/charnames.pm b/lib/charnames.pm index 80f31e7..3209f29 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -55,7 +55,7 @@ sub charnames if ($name eq "BYTE ORDER MARK") { $fname = $name; - $ord = 0xFFFE; + $ord = 0xFEFF; } else { ## Suck in the code/name list as a big string. ## Lines look like: @@ -208,7 +208,7 @@ sub viacode if ($txt =~ m/^$hex\t\t(.+)/m) { return $viacode{$hex} = $1; - } elsif ($hex eq 'FFFE') { + } elsif ($hex eq 'FEFF') { return $viacode{$hex} = "BYTE ORDER MARK"; } else { carp "Unknown charcode '$hex'"; diff --git a/lib/charnames.t b/lib/charnames.t index 42c2205..730ce18 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -196,7 +196,7 @@ print "ok 31\n"; print "not " unless "\N{BYTE ORDER MARK}" eq chr(0xFFFE); print "ok 32\n"; -print "not " unless "\N{BOM}" eq chr(0xFFFE); +print "not " unless "\N{BOM}" eq chr(0xFEFF); print "ok 33\n"; { @@ -217,6 +217,6 @@ print "ok 33\n"; print "ok 37\n"; } -print "not " unless charnames::viacode(0xFFFE) eq "BYTE ORDER MARK"; +print "not " unless charnames::viacode(0xFEFF) eq "BYTE ORDER MARK"; print "ok 38\n";