From 59d76227caa0d8304f243bd8d2d8534ed6d80e81 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 3 Apr 2008 21:58:28 +0000 Subject: Bug 410902: Some characters are mangled in diff and interdiff modes when viewing patches - Patch by Frédéric Buclin r=shimono, r=mkanat a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Util.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Util.pm') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index da41008e1..e7a76e21d 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -44,7 +44,7 @@ use base qw(Exporter); file_mod_time is_7bit_clean bz_crypt generate_random_password validate_email_syntax clean_text - get_text); + get_text disable_utf8); use Bugzilla::Constants; @@ -534,6 +534,12 @@ sub get_netaddr { return join(".", unpack("CCCC", pack("N", $addr))); } +sub disable_utf8 { + if (Bugzilla->params->{'utf8'}) { + binmode STDOUT, ':raw'; # Turn off UTF8 encoding. + } +} + 1; __END__ @@ -781,6 +787,10 @@ The search starts at $maxpos and goes back to the beginning of the string. Returns true is the string contains only 7-bit characters (ASCII 32 through 126, ASCII 10 (LineFeed) and ASCII 13 (Carrage Return). +=item C + +Disable utf8 on STDOUT (and display raw data instead). + =item C Returns the parameter "cleaned" by exchanging non-printable characters with spaces. Specifically characters (ASCII 0 through 31) and (ASCII 127) will become ASCII 32 (Space). -- cgit v1.2.3-24-g4f1b