Skip to content

Commit fa4e9d6

Browse files
committed
Fixed Emoji encode & decode bug.
1 parent 094326c commit fa4e9d6

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Ma Bingyao <andot@hprose.com>",
33
"name": "hprose-html5",
4-
"version": "2.0.2",
4+
"version": "2.0.3",
55
"description": "Hprose is a High Performance Remote Object Service Engine. It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware.",
66
"keywords": [
77
"hprose",

dist/hprose-html5.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hprose-html5",
33
"filename": "hprose-html5.js",
4-
"version": "2.0.2",
4+
"version": "2.0.3",
55
"description": "Hprose is a High Performance Remote Object Service Engine. It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.",
66
"homepage": "https://github.com/andot/hprose",
77
"keywords": [

src/BytesIO.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* *
1414
* hprose BytesIO for HTML5. *
1515
* *
16-
* LastModified: Aug 11, 2015 *
16+
* LastModified: Aug 21, 2015 *
1717
* Author: Ma Bingyao <andot@hprose.com> *
1818
* *
1919
\**********************************************************/
@@ -64,8 +64,8 @@
6464
if (i + 1 < n) {
6565
var nextCodeUnit = str.charCodeAt(i + 1);
6666
if (codeUnit < 0xDC00 && 0xDC00 <= nextCodeUnit && nextCodeUnit <= 0xDFFF) {
67-
var rune = (((codeUnit & 0xDC00) << 10) | (nextCodeUnit & 0x03FF)) + 0x010000;
68-
bytes[p++] = 0xF0 | ((rune >> 18) & 0x3F);
67+
var rune = (((codeUnit & 0x03FF) << 10) | (nextCodeUnit & 0x03FF)) + 0x010000;
68+
bytes[p++] = 0xF0 | (rune >> 18);
6969
bytes[p++] = 0x80 | ((rune >> 12) & 0x3F);
7070
bytes[p++] = 0x80 | ((rune >> 6) & 0x3F);
7171
bytes[p++] = 0x80 | (rune & 0x3F);
@@ -117,10 +117,10 @@
117117
break;
118118
case 15:
119119
if (off + 2 < len) {
120-
var rune = ((unit & 0x07) << 18) |
120+
var rune = (((unit & 0x07) << 18) |
121121
((bytes[off++] & 0x3F) << 12) |
122122
((bytes[off++] & 0x3F) << 6) |
123-
(bytes[off++] & 0x3F) - 0x10000;
123+
(bytes[off++] & 0x3F)) - 0x10000;
124124
if (0 <= rune && rune <= 0xFFFFF) {
125125
charCodes[i++] = (((rune >> 10) & 0x03FF) | 0xD800);
126126
charCodes[i] = ((rune & 0x03FF) | 0xDC00);
@@ -182,10 +182,10 @@
182182
break;
183183
case 15:
184184
if (off + 2 < len) {
185-
var rune = ((unit & 0x07) << 18) |
185+
var rune = (((unit & 0x07) << 18) |
186186
((bytes[off++] & 0x3F) << 12) |
187187
((bytes[off++] & 0x3F) << 6) |
188-
(bytes[off++] & 0x3F) - 0x10000;
188+
(bytes[off++] & 0x3F)) - 0x10000;
189189
if (0 <= rune && rune <= 0xFFFFF) {
190190
charCodes[i++] = (((rune >> 10) & 0x03FF) | 0xD800);
191191
charCodes[i] = ((rune & 0x03FF) | 0xDC00);
@@ -257,10 +257,10 @@
257257
break;
258258
case 15:
259259
if (off + 2 < len) {
260-
var rune = ((unit & 0x07) << 18) |
260+
var rune = (((unit & 0x07) << 18) |
261261
((bytes[off++] & 0x3F) << 12) |
262262
((bytes[off++] & 0x3F) << 6) |
263-
(bytes[off++] & 0x3F) - 0x10000;
263+
(bytes[off++] & 0x3F)) - 0x10000;
264264
if (0 <= rune && rune <= 0xFFFFF) {
265265
i++;
266266
}

src/CopyRight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Hprose for HTML5 v2.0.1
1+
// Hprose for HTML5 v2.0.3
22
// Copyright (c) 2008-2015 http://hprose.com
33
// Hprose is freely distributable under the MIT license.
44
// For all details and documentation:

0 commit comments

Comments
 (0)