Guest User

Untitled

a guest
Jun 25th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. diff --git i/BugsSite/committers-autocomplete.js w/BugsSite/committers-autocomplete.js
  2. index 5b5bbfc..c9fd50d 100644
  3. --- i/BugsSite/committers-autocomplete.js
  4. +++ w/BugsSite/committers-autocomplete.js
  5. @@ -55,7 +55,7 @@ WebKitCommitters = (function() {
  6. var parsedResult = {};
  7.  
  8. // full name
  9. - var param = /^\s*((\[[^\]]+\])|u?("[^"]+"))\s*/g; // For emacs " to balance the quotes.
  10. + var param = /^\s*((\[[^\]]+\])|(u?)("[^"]+"))\s*/g; // For emacs " to balance the quotes.
  11. param.lastIndex = 0;
  12. var nameParam = param.exec(record);
  13. if (!nameParam)
  14. @@ -63,7 +63,19 @@ WebKitCommitters = (function() {
  15. record = record.substring(param.lastIndex);
  16.  
  17. // Save the name without the quotes.
  18. - parsedResult.name = nameParam[3].slice(1, nameParam[3].length - 1);
  19. + var name = nameParam[4].slice(1, nameParam[4].length - 1);
  20. +
  21. + // Convert unicode characters
  22. + if (nameParam[3] == 'u') {
  23. + var unicode = /\\u([a-f\d]{4})/gi;
  24. + var match = unicode.exec(name);
  25. + while (match) {
  26. + name = name.replace(match[0], String.fromCharCode(parseInt(match[1], 16)));
  27. + match = unicode.exec(name);
  28. + }
  29. + }
  30. +
  31. + parsedResult.name = name;
  32.  
  33. var paramSeparator = /^\s*,\s*/g;
  34. paramSeparator.lastIndex = 0;
Add Comment
Please, Sign In to add comment