MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / ucs2encode

Function ucs2encode

public/javascripts/socket.io.js:6366–6381  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

6364
6365 // Taken from https://mths.be/punycode
6366 function ucs2encode(array) {
6367 var length = array.length;
6368 var index = -1;
6369 var value;
6370 var output = '';
6371 while (++index < length) {
6372 value = array[index];
6373 if (value > 0xFFFF) {
6374 value -= 0x10000;
6375 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
6376 value = 0xDC00 | value & 0x3FF;
6377 }
6378 output += stringFromCharCode(value);
6379 }
6380 return output;
6381 }
6382
6383 /*--------------------------------------------------------------------------*/
6384

Callers 1

wtf8decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected