INNER CODE UNIT · JavaScript
FILENAME_INVISIBLE
increpare/flickgame · flickgame_share.js:55
var FILENAME_INVISIBLE = /[\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u2069\ufeff]/g;
var FILENAME_RESERVED = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;
var FILENAME_MAX_BYTES = 120;
function isHighSurrogate(c) { return c >= 0xd800 && c <= 0xdbff; }
function isLowSurrogate(c) { return c >= 0xdc00 && c <= 0xdfff; }
// Deliberately arithmetic rather than encodeURIComponent, which throws URIError on
// an unpaired surrogate - and user text pasted into a link field can contain one.
function utf8ByteLength(str) {
var bytes = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
if (c < 0x80) bytes += 1;
else if (c < 0x800) bytes += 2;
else if (isHighSurrogate(c) && i + 1 < str.length && isLowSurrogate(str.charCodeAt(i + 1))) {
bytes += 4;
i++;