mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib/MHonArc/UTF8 Encode.pm,1.1,1.2 MapUTF8.pm,1.1,1.2 ...

2003-03-05 15:17:22
Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/UTF8
In directory subversions:/tmp/cvs-serv20374/UTF8

Modified Files:
	Encode.pm MapUTF8.pm MhaEncode.pm 
Log Message:
* Removed escaping of '@' for similiar reasons as was done in ewhutil.pl.
  Should eventually consolidate HTMLSpecials so they are not defined
  in two different places.
* Defined $HTMLSpecials scalar for use in regexes.  Makes it easier
  to update specials without having to change source in multiple files.


Index: Encode.pm
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/UTF8/Encode.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Encode.pm	18 Dec 2002 05:38:44 -0000	1.1
--- Encode.pm	5 Mar 2003 22:17:15 -0000	1.2
***************
*** 124,138 ****
  	    $charset = 'iso-8859-1';
  	} else {
! 	    $$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	    return $$text_r;
  	}
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	return $$text_r;
      }
      eval {
  	Encode::from_to($$text_r, $charset, 'utf8');
! 	$$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
      };
      if ($@) {
--- 124,138 ----
  	    $charset = 'iso-8859-1';
  	} else {
! 	    $$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	    return $$text_r;
  	}
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	return $$text_r;
      }
      eval {
  	Encode::from_to($$text_r, $charset, 'utf8');
! 	$$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
      };
      if ($@) {

Index: MapUTF8.pm
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/UTF8/MapUTF8.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** MapUTF8.pm	18 Dec 2002 05:38:44 -0000	1.1
--- MapUTF8.pm	5 Mar 2003 22:17:15 -0000	1.2
***************
*** 120,133 ****
  	    $charset = 'iso-8859-1';
  	} else {
! 	    $$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	    return $$text_r;
  	}
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	return $$text_r;
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	return $$text_r;
      }
--- 120,133 ----
  	    $charset = 'iso-8859-1';
  	} else {
! 	    $$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	    return $$text_r;
  	}
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	return $$text_r;
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	return $$text_r;
      }
***************
*** 135,139 ****
  	$$text_r = Unicode::MapUTF8::to_utf8(
  	    {-string => $$text_r, -charset => $charset});
! 	$$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	return $$text_r;
      }
--- 135,139 ----
  	$$text_r = Unicode::MapUTF8::to_utf8(
  	    {-string => $$text_r, -charset => $charset});
! 	$$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	return $$text_r;
      }

Index: MhaEncode.pm
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/UTF8/MhaEncode.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** MhaEncode.pm	26 Dec 2002 21:57:05 -0000	1.2
--- MhaEncode.pm	5 Mar 2003 22:17:15 -0000	1.3
***************
*** 197,210 ****
  	    $charset = 'iso-8859-1';
  	} else {
! 	    $$data_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	    return $$data_r;
  	}
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$data_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
  	return $$data_r;
      }
      MHonArc::Char::map_conv($data_r, $charset, $char_maps);
!     $$data_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
      $$data_r;
  }
--- 197,210 ----
  	    $charset = 'iso-8859-1';
  	} else {
! 	    $$data_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	    return $$data_r;
  	}
      }
      if ($charset eq 'utf-8' || $charset eq 'utf8') {
! 	$$data_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	return $$data_r;
      }
      MHonArc::Char::map_conv($data_r, $charset, $char_maps);
!     $$data_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
      $$data_r;
  }

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV