From 83adc448c422fb39103f1c69b2cd9cb91392f31b Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 28 Nov 2012 20:35:45 -0700 Subject: [PATCH] charnames: Check for enabled warnings before warning This message should be suppressed if non_unicode warnings are turned off. --- lib/_charnames.pm | 6 ++++-- lib/charnames.pm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/_charnames.pm b/lib/_charnames.pm index bbb7378..c9bca48 100644 --- a/lib/_charnames.pm +++ b/lib/_charnames.pm @@ -7,7 +7,7 @@ package _charnames; use strict; use warnings; use File::Spec; -our $VERSION = '1.33'; +our $VERSION = '1.34'; use unicore::Name; # mktables-generated algorithmically-defined names use bytes (); # for $bytes::hint_bits @@ -765,7 +765,9 @@ sub viacode { # Here there is no user-defined alias, return any official one. return $return if defined $return; - if (CORE::hex($hex) > 0x10FFFF) { + if (CORE::hex($hex) > 0x10FFFF + && warnings::enabled('non_unicode')) + { carp "Unicode characters only allocated up to U+10FFFF (you asked for U+$hex)"; } return; diff --git a/lib/charnames.pm b/lib/charnames.pm index 559dc4f..2dd3b62 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -1,7 +1,7 @@ package charnames; use strict; use warnings; -our $VERSION = '1.33'; +our $VERSION = '1.34'; use unicore::Name; # mktables-generated algorithmically-defined names use _charnames (); # The submodule for this where most of the work gets done -- 2.7.4