Lines Matching refs:encoding
373 Buffer.alloc = function alloc(size, fill, encoding) { argument
377 return _fill(buf, fill, 0, buf.length, encoding);
445 function fromString(string, encoding) { argument
447 if (typeof encoding !== 'string' || encoding.length === 0) {
451 encoding = undefined;
453 ops = getEncodingOps(encoding);
455 throw new ERR_UNKNOWN_ENCODING(encoding);
543 Buffer.isEncoding = function isEncoding(encoding) { argument
544 return typeof encoding === 'string' && encoding.length !== 0 &&
545 normalizeEncoding(encoding) !== undefined;
605 encoding: 'utf8', property
614 encoding: 'ucs2', property
623 encoding: 'utf16le', property
632 encoding: 'latin1', property
641 encoding: 'ascii', property
654 encoding: 'base64', property
667 encoding: 'base64url', property
681 encoding: 'hex', property
694 function getEncodingOps(encoding) { argument
695 encoding += '';
696 switch (encoding.length) {
698 if (encoding === 'utf8') return encodingOps.utf8;
699 if (encoding === 'ucs2') return encodingOps.ucs2;
700 encoding = StringPrototypeToLowerCase(encoding);
701 if (encoding === 'utf8') return encodingOps.utf8;
702 if (encoding === 'ucs2') return encodingOps.ucs2;
705 if (encoding === 'utf-8') return encodingOps.utf8;
706 if (encoding === 'ascii') return encodingOps.ascii;
707 if (encoding === 'ucs-2') return encodingOps.ucs2;
708 encoding = StringPrototypeToLowerCase(encoding);
709 if (encoding === 'utf-8') return encodingOps.utf8;
710 if (encoding === 'ascii') return encodingOps.ascii;
711 if (encoding === 'ucs-2') return encodingOps.ucs2;
714 if (encoding === 'utf16le' ||
715 StringPrototypeToLowerCase(encoding) === 'utf16le')
719 if (encoding === 'utf-16le' ||
720 StringPrototypeToLowerCase(encoding) === 'utf-16le')
724 if (encoding === 'latin1' || encoding === 'binary')
726 if (encoding === 'base64') return encodingOps.base64;
727 encoding = StringPrototypeToLowerCase(encoding);
728 if (encoding === 'latin1' || encoding === 'binary')
730 if (encoding === 'base64') return encodingOps.base64;
733 if (encoding === 'hex' || StringPrototypeToLowerCase(encoding) === 'hex')
737 if (encoding === 'base64url' ||
738 StringPrototypeToLowerCase(encoding) === 'base64url')
744 function byteLength(string, encoding) { argument
760 if (!encoding)
763 const ops = getEncodingOps(encoding);
798 Buffer.prototype.toString = function toString(encoding, start, end) { argument
820 if (encoding === undefined)
823 const ops = getEncodingOps(encoding);
825 throw new ERR_UNKNOWN_ENCODING(encoding);
930 function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { argument
934 encoding = byteOffset;
953 if (encoding === undefined)
956 ops = getEncodingOps(encoding);
960 throw new ERR_UNKNOWN_ENCODING(encoding);
975 Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { argument
976 return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
979 Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { argument
980 return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
983 Buffer.prototype.includes = function includes(val, byteOffset, encoding) { argument
984 return this.indexOf(val, byteOffset, encoding) !== -1;
991 Buffer.prototype.fill = function fill(value, offset, end, encoding) { argument
992 return _fill(this, value, offset, end, encoding);
995 function _fill(buf, value, offset, end, encoding) { argument
998 encoding = offset;
1002 encoding = end;
1006 const normalizedEncoding = normalizeEncoding(encoding);
1008 validateString(encoding, 'encoding');
1009 throw new ERR_UNKNOWN_ENCODING(encoding);
1027 encoding = undefined;
1055 const res = bindingFill(buf, value, offset, end, encoding);
1066 Buffer.prototype.write = function write(string, offset, length, encoding) { argument
1073 encoding = offset;
1086 encoding = length;
1095 if (!encoding)
1098 const ops = getEncodingOps(encoding);
1100 throw new ERR_UNKNOWN_ENCODING(encoding);