Convert verbatim unicode values in comitter names to characters
authorvestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Sep 2010 11:40:02 +0000 (11:40 +0000)
committervestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Sep 2010 11:40:02 +0000 (11:40 +0000)
Reviewed by Csaba Osztrogonác.

* committers-autocomplete.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

BugsSite/ChangeLog
BugsSite/committers-autocomplete.js

index 83ebe74..ac2c098 100644 (file)
@@ -1,3 +1,11 @@
+2010-09-28  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Convert verbatim unicode values in comitter names to characters
+
+        * committers-autocomplete.js:
+
 2010-09-24  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         Reviewed by Csaba Osztrogonác.
index 5b5bbfc..c9fd50d 100644 (file)
@@ -55,7 +55,7 @@ WebKitCommitters = (function() {
         var parsedResult = {};
 
         // full name
-        var param = /^\s*((\[[^\]]+\])|u?("[^"]+"))\s*/g; // For emacs " to balance the quotes.
+        var param = /^\s*((\[[^\]]+\])|(u?)("[^"]+"))\s*/g; // For emacs " to balance the quotes.
         param.lastIndex = 0;
         var nameParam = param.exec(record);
         if (!nameParam)
@@ -63,7 +63,19 @@ WebKitCommitters = (function() {
         record = record.substring(param.lastIndex);
 
         // Save the name without the quotes.
-        parsedResult.name = nameParam[3].slice(1, nameParam[3].length - 1);
+        var name = nameParam[4].slice(1, nameParam[4].length - 1);
+
+        // Convert unicode characters
+        if (nameParam[3] == 'u') {
+            var unicode = /\\u([a-f\d]{4})/gi;
+            var match = unicode.exec(name);
+            while (match) {
+                name = name.replace(match[0], String.fromCharCode(parseInt(match[1], 16)));
+                match = unicode.exec(name);
+            }
+        }
+
+        parsedResult.name = name;
 
         var paramSeparator = /^\s*,\s*/g;
         paramSeparator.lastIndex = 0;