(string)
| 57 | }, |
| 58 | |
| 59 | _utf8Encode(string) { |
| 60 | string = string.replace(/\r\n/g, '\n'); |
| 61 | let utftext = ''; |
| 62 | for (let n = 0; n < string.length; n++) { |
| 63 | const c = string.charCodeAt(n); |
| 64 | if (c < 128) { |
| 65 | utftext += String.fromCharCode(c); |
| 66 | } else if ((c > 127) && (c < 2048)) { |
| 67 | utftext += String.fromCharCode((c >> 6) | 192); |
| 68 | utftext += String.fromCharCode((c & 63) | 128); |
| 69 | } else { |
| 70 | utftext += String.fromCharCode((c >> 12) | 224); |
| 71 | utftext += String.fromCharCode(((c >> 6) & 63) | 128); |
| 72 | utftext += String.fromCharCode((c & 63) | 128); |
| 73 | } |
| 74 | } |
| 75 | return utftext; |
| 76 | }, |
| 77 | |
| 78 | _utf8Decode(utftext) { |
| 79 | let string = ''; |
nothing calls this directly
no outgoing calls
no test coverage detected