* StringDecoder provides an interface for efficiently splitting a series of * buffers into a series of JS strings without breaking apart multibyte * characters. * @param {string} [encoding]
(encoding)
| 58 | * @param {string} [encoding] |
| 59 | */ |
| 60 | function StringDecoder(encoding) { |
| 61 | this.encoding = normalizeEncoding(encoding); |
| 62 | if (this.encoding === undefined) { |
| 63 | throw new ERR_UNKNOWN_ENCODING(encoding); |
| 64 | } |
| 65 | this[kNativeDecoder] = Buffer.alloc(kSize); |
| 66 | this[kNativeDecoder][kEncodingField] = encodingsMap[this.encoding]; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Returns a decoded string, omitting any incomplete multi-bytes |
nothing calls this directly
no test coverage detected