1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-06-15 03:35:16 +00:00

Simplified the surrogate-to-codepoint algorithm

This commit is contained in:
JoshyPHP 2015-04-24 19:46:22 +02:00
parent 3e21d10e5a
commit af8c1968d3
5 changed files with 5 additions and 5 deletions

View File

@ -853,7 +853,7 @@ function createTwemoji(re) {
while (i < unicodeSurrogates.length) {
c = unicodeSurrogates.charCodeAt(i++);
if (p) {
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
r.push(((p << 10) + c - 56613888).toString(16));
p = 0;
} else if (0xD800 <= c && c <= 0xDBFF) {
p = c;

View File

@ -576,7 +576,7 @@ define(function () {
while (i < unicodeSurrogates.length) {
c = unicodeSurrogates.charCodeAt(i++);
if (p) {
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
r.push(((p << 10) + c - 56613888).toString(16));
p = 0;
} else if (0xD800 <= c && c <= 0xDBFF) {
p = c;

View File

@ -575,7 +575,7 @@ var twemoji = (function (
while (i < unicodeSurrogates.length) {
c = unicodeSurrogates.charCodeAt(i++);
if (p) {
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
r.push(((p << 10) + c - 56613888).toString(16));
p = 0;
} else if (0xD800 <= c && c <= 0xDBFF) {
p = c;

2
twemoji.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -576,7 +576,7 @@ var twemoji = (function (
while (i < unicodeSurrogates.length) {
c = unicodeSurrogates.charCodeAt(i++);
if (p) {
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
r.push(((p << 10) + c - 56613888).toString(16));
p = 0;
} else if (0xD800 <= c && c <= 0xDBFF) {
p = c;