Index: lib/Foswiki/Plugins/JQGridPlugin/GRID.pm
===================================================================
--- lib/Foswiki/Plugins/JQGridPlugin/GRID.pm	(revision 10645)
+++ lib/Foswiki/Plugins/JQGridPlugin/GRID.pm	(working copy)
@@ -315,9 +315,15 @@
   var grid = \$(this);
   var lastSel = grid.data('lastSel');
   if(id && id !== lastSel) { 
-    grid.jqGrid('restoreRow', lastSel); 
-    grid.jqGrid('editRow', id, true, 
-      true, //oneditfunc
+    if (lastSel) {
+      grid.jqGrid('restoreRow', lastSel); 
+    }
+    grid.jqGrid('editRow', 
+      id, 
+      true, 
+      function(id) { //oneditfunc
+        //console.log('called oneditfunc');
+      },
       function(id) { // successfunc
         \$.log("GRID: success");
         grid.trigger("reloadGrid");
@@ -340,7 +346,7 @@
       }
     ); 
     grid.data("lastSel", id);
-  } 
+  }
 }
 HERE
       push @metadata, $onSelect;
@@ -451,6 +457,7 @@
   foreach my $key (@params) {
     next if $key =~ /^(id|oper)$/;
     my $val = $request->param($key);
+    $val = fromUtf8($val);
     $val =~ s/^\s+//;
     $val =~ s/\s+$//;
     my $field = $meta->get('FIELD', $key);
@@ -707,4 +714,47 @@
   return $text;
 }
 
+=begin TML
+
+---++ StaticMethod fromUtf8 ($string) -> $string
+
+converts an utf8 string to its internal representation
+
+=cut
+
+sub fromUtf8 {
+  my $string = shift;
+
+  my $charset = $Foswiki::cfg{Site}{CharSet};
+  return $string if $charset =~ /^utf-?8$/i;
+
+  if ($] < 5.008) {
+
+    # use Unicode::MapUTF8 for Perl older than 5.8
+    require Unicode::MapUTF8;
+    if (Unicode::MapUTF8::utf8_supported_charset($charset)) {
+      return Unicode::MapUTF8::from_utf8({ -string => $string, -charset => $charset });
+    } else {
+      print STDERR 'Warning: Conversion from $encoding no supported, ' . 'or name not recognised - check perldoc Unicode::MapUTF8'."\n";
+      return $string;
+    }
+  } else {
+
+    # good Perl version, just use Encode
+    require Encode;
+    import Encode;
+    my $encoding = Encode::resolve_alias($charset);
+    if (not $encoding) {
+      print STDERR 'Warning: Conversion to "' . $charset . '" not supported, or name not recognised - check ' . '"perldoc Encode::Supported"'."\n";;
+      return $string;
+    } else {
+
+      # converts to $charset, generating HTML NCR's when needed
+      my $octets = $string;
+      $octets = Encode::decode('utf-8', $string) unless utf8::is_utf8($string);
+      return Encode::encode($encoding, $octets, 0);
+    }
+  }
+}
+
 1;
