[Home]WikiPatches/Hungarian

UseModWiki | WikiPatches | RecentChanges | Preferences

Hungarian Patch

Description

In order to make Hungarian text work properly on all browsers, the following patch needs to be applied. This fixes o-tilde vs o-doubleacute and u-circ vs u-doubleacute problems that sometimes make pages look nasty.

In order to fix this, two things need to be done:

  1. Replace $q->textarea with <textarea> tags as CGI is quite fond of destroying special characters
  2. Translate incoming unicode o-tolde and u-circ characters with latin2 encoding.

Patch

--- wiki.pl     2003-09-11 14:21:02.000000000 +0200
+++ Latin2Patch.pl      2005-10-04 09:48:00.000000000 +0200
@@ -3312,13 +3312,9 @@
   my ($name, $text, $rows, $cols) = @_;

   if (&GetParam("editwide", 1)) {
-    return $q->textarea(-name=>$name, -default=>$text,
-                        -rows=>$rows, -columns=>$cols, -override=>1,
-                        -style=>'width:100%', -wrap=>'virtual');
-  }
-  return $q->textarea(-name=>$name, -default=>$text,
-                      -rows=>$rows, -columns=>$cols, -override=>1,
-                      -wrap=>'virtual');
+    return "<textarea name=\"$name\" rows=$rows cols=$cols style=\"width:100%\" wrap=virtual>$text</textarea>";
+  }
+  return "<textarea name=\"$name\" rows=$rows cols=$cols wrap=virtual>$text</textarea>";
 }

 sub DoEditPrefs {
@@ -3895,7 +3891,13 @@
   my $isEdit = 0;
   my $editTime = $Now;
   my $authorAddr = $ENV{REMOTE_ADDR};
-
+
+  if ($HttpCharset eq "iso-8859-2") {
+    $string =~ s/&#245;/\xf5/g;
+    $string =~ s/&#251;/\xfb/g;
+    $string =~ s/&#213;/\xd5/g;
+    $string =~ s/&#219;/\xdb/g;
+  }
   if (!&UserCanEdit($id, 1)) {
     # This is an internal interface--we don't need to explain
     &ReportError(Ts('Editing not allowed for %s.', $id));

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 12, 2007 11:23 am by JuanmaMP (diff)
Search: