[gnome-characters] character: Fix surrogate range calculation



commit 90c74cb7b8060833b127ea68ef7f09a71b2a1daa
Author: Daiki Ueno <dueno src gnome org>
Date:   Thu Jul 2 16:12:51 2015 +0900

    character: Fix surrogate range calculation

 src/util.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/util.js b/src/util.js
index 90ecc77..14e8bf1 100644
--- a/src/util.js
+++ b/src/util.js
@@ -134,7 +134,7 @@ function capitalize(s) {
 
 function toCodePoint(s) {
     let codePoint = s.charCodeAt(0);
-    if (codePoint > 0xD800) {
+    if (codePoint >= 0xD800 && codePoint <= 0xDBFF) {
         let high = codePoint;
         let low = s.charCodeAt(1);
         codePoint = 0x10000 + (high - 0xD800) * 0x400 + (low - 0xDC00);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]