From 35f1ce88e12f8eee0d47fdc69d38cd7a4b12732d Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 4 Aug 2005 18:51:22 +0000 Subject: Bug 126266: Use UTF-8 (Unicode) charset encoding for pages and email for NEW installations - Patch by byron jones (glob) r=wurblzap a=justdave --- Bugzilla/Util.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Util.pm') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index b694de752..43100b160 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -38,7 +38,7 @@ use base qw(Exporter); diff_arrays diff_strings trim wrap_comment find_wrap_point format_time format_time_decimal - file_mod_time + file_mod_time is_7bit_clean bz_crypt check_email_syntax); use Bugzilla::Config; @@ -374,6 +374,10 @@ sub ValidateDate { } } +sub is_7bit_clean { + return $_[0] !~ /[^\x20-\x7E\x0A\x0D]/; +} + 1; __END__ @@ -597,6 +601,11 @@ Search for a comma, a whitespace or a hyphen to split $string, within the first $maxpos characters. If none of them is found, just split $string at $maxpos. The search starts at $maxpos and goes back to the beginning of the string. +=item C + +Returns true is the string contains only 7-bit characters (ASCII 32 through 126, +ASCII 10 (LineFeed) and ASCII 13 (Carrage Return). + =back =head2 Formatting Time -- cgit v1.2.3-24-g4f1b