| /arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/ |
| D | escompat_ArrayBuffer.cpp | 49 * @brief Converts an ETS string to bytes using specified encoding 64 PandaString encoding = in ConvertEtsStringToBytes() local 66 auto res = helpers::encoding::ConvertStringToBytes(input, encoding); in ConvertEtsStringToBytes() 83 PandaString encoding = in EtsStringBytesLength() local 85 auto res = helpers::encoding::CalculateStringBytesLength(input, encoding); in EtsStringBytesLength() 176 * @brief Converts ArrayBuffer content to string using specified encoding. 179 * determines the encoding, and then converts the byte sequence into the desired string. 187 auto vb = helpers::encoding::ValidateBuffer(buffer); in EtsArrayBufferToString() 198 auto vi = helpers::encoding::ValidateIndices(byteLength, start, end); in EtsArrayBufferToString() 212 PandaString encoding = in EtsArrayBufferToString() local [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/helpers/ |
| D | array_buffer_helper.h | 61 namespace encoding { 67 * @brief Retrieves the encoding string from an optional encoding pointer. 76 PandaString ConvertBase64Encoding(const PandaVector<uint8_t> &bytes, std::string_view encoding); 82 …lt<PandaVector<uint8_t>> ConvertStringToBytes(const PandaString &input, std::string_view encoding); 84 /// @brief Calculates the number of bytes required to represent the string in the given encoding. 85 Result<int32_t> CalculateStringBytesLength(std::string_view input, std::string_view encoding); 87 } // namespace encoding
|
| D | array_buffer_helper.cpp | 44 // Bit shift constants for Base64 encoding/decoding. 183 namespace encoding { namespace 271 PandaString ConvertBase64Encoding(const PandaVector<uint8_t> &bytes, std::string_view encoding) in ConvertBase64Encoding() argument 274 if (encoding == "base64url") { in ConvertBase64Encoding() 336 …ult<PandaVector<uint8_t>> ConvertBase64ToBytes(const PandaString &input, std::string_view encoding) in ConvertBase64ToBytes() argument 339 if (encoding == "base64url") { in ConvertBase64ToBytes() 424 …ult<PandaVector<uint8_t>> ConvertStringToBytes(const PandaString &input, std::string_view encoding) in ConvertStringToBytes() argument 426 if (std::find(UTF8_ENCODINGS.begin(), UTF8_ENCODINGS.end(), encoding) != UTF8_ENCODINGS.end()) { in ConvertStringToBytes() 429 …if (std::find(ASCII_ENCODINGS.begin(), ASCII_ENCODINGS.end(), encoding) != ASCII_ENCODINGS.end()) { in ConvertStringToBytes() 432 …if (std::find(UTF16_ENCODINGS.begin(), UTF16_ENCODINGS.end(), encoding) != UTF16_ENCODINGS.end()) { in ConvertStringToBytes() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/sdk/api/ |
| D | @ohos.util.stream.ets | 77 * Specifies the encoding format of the data. If this parameter is provided, 78 …* the readable stream decodes the data into a string in the specified encoding format. Default: ut… 80 …* Supported encoding formats: utf-8, ibm866, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8… 88 encoding?: string; 95 constructor(encoding?: string) {} 263 * @param { string } [encoding] - Encoding type. 274 write(chunk?: string | Uint8Array, encoding?: string, callback?: () => void): boolean { 282 * @param { string } [encoding] - Encoding type. 291 end(chunk?: string | Uint8Array, encoding?: string, callback?: () => void): Writable { 296 * Set the default encoding mode. [all …]
|
| D | @ohos.buffer.ets | 114 * for handling binary data and various encoding operations. 179 … { number | string } offsetOrEncoding - offsetOrEncoding offsetOrEncoding A byte-offset or encoding 202 * Creates a new Buffer containing the provided string encoded using the specified encoding. 205 * @param {BufferEncoding} [encoding='utf8'] - The character encoding to use 208 export function from(string: String, encoding?: BufferEncoding): Buffer { 209 const resolvedEncoding: string = (encoding ?? "utf8"); 223 } else if (encoding == 'base64' || encoding == 'base64url') { 230 * Returns the byte length of a string when encoded using `encoding`. 232 * for the encoding that is used to convert the string into bytes. 235 * @param {BufferEncoding} [encoding='utf8'] - If `string` is a string, this is its encoding [all …]
|
| D | @ohos.util.ets | 319 * @param options The encoding options (Base64 type). 337 * @param options The encoding options (Base64 type). 388 * @param options The encoding options (Base64 type). 426 * @param options The encoding options (Base64 type). 675 constructor(encoding?: string, options?: TextDecoderOptions) { 677 if (encoding) { 678 this.encoding_ = encoding; 690 static create(encoding?: string, options?: TextDecoderOptions): TextDecoder { 691 return new TextDecoder(encoding, options); 701 get encoding(): string { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/ |
| D | TextEncoderTest.ets | 193 let str = enc.encoding; 200 let str = enc.encoding; 203 str = enc.encoding; 210 let str = enc.encoding; 213 str = enc.encoding; 216 str = enc.encoding; 223 let str = enc.encoding; 226 str = enc.encoding; 229 str = enc.encoding; 236 let str = enc.encoding; [all …]
|
| D | TextDecoderTest.ets | 118 let retStr = textDecode.encoding; 129 let encodingStr = textDecode.encoding; 140 let encodingStr = textDecode.encoding; 151 let encodingStr = textDecode.encoding;
|
| /arkcompiler/ets_runtime/ecmascript/containers/ |
| D | containers_buffer.cpp | 128 … "Parameter error. The type of \"encoding\" must be BufferEncoding. the encoding code is unknown"); in BufferConstructor() 296 JSHandle<JSTaggedValue> encoding = GetCallArg(argv, 2); // 2 means the third arg in IndexOf() local 298 if (encoding->IsString()) { in IndexOf() 299 if (!IsValidEncoding(thread, encoding)) { in IndexOf() 302 … "Parameter error. The type of \"encoding\" must be BufferEncoding. the encoding code is unknown"); in IndexOf() 305 … encodingType = JSAPIFastBuffer::GetEncodingType(JSAPIFastBuffer::GetString(thread, encoding)); in IndexOf() 335 JSHandle<JSTaggedValue> encoding = GetCallArg(argv, 2); // 2 means the third arg in Includes() local 337 if (encoding->IsString()) { in Includes() 338 if (!IsValidEncoding(thread, encoding)) { in Includes() 341 … "Parameter error. The type of \"encoding\" must be BufferEncoding. the encoding code is unknown"); in Includes() [all …]
|
| /arkcompiler/runtime_core/taihe/compiler/taihe/codegen/abi/ |
| D | mangle.py | 59 - Position encoding uses ULEB128 for compact representation 86 List of bytes representing the ULEB8 encoding 92 raise ValueError("ULEB8 encoding requires non-negative values") 202 raise ValueError("Invalid mangled name: missing kind marker or encoding") 206 encoding = mangled_name[last_underscore + 2 :] 213 while pos < len(encoding): 214 delta, consumed = _decode_uleb8(encoding, pos)
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/xml/ |
| D | XmlPullParserTest3.ets | 51 …"<?xml version='1.0' encoding=\"utf-8\"?><!DOCTYPE example [<!ENTITY exampleEntity 'some entity'>]… 74 '<?xml version="1.0" encoding="utf-8"?>' + 99 '<?xml version="1.0" encoding="utf-8"?>' + 125 '<?xml version="1.0" encoding="utf-8"?>' + 149 let strXml = '<?xml version="1.0" encoding="utf-8"?><note>Happy</note>'; 170 let strXml = '<?xml version="1.0" encoding="utf-8"?><note>Ha$ppy</note>'; 192 '<?xml version="1.0" encoding="utf-8"?>' + 215 let strXml = '<?xml version="1.0" encoding="utf-8"?><note><to>Work</to></note>'; 237 let strXml = '<?xml version="1.0" encoding="utf-8"?>' + 264 '<?xml version="1.0" encoding="utf-8"?>' + [all …]
|
| D | XmlPullParserTest9.ets | 49 '<?xml version="1.0" encoding="utf-8"?>' + 78 '<?xml version="1.0" encoding="utf-8" ?>' + 99 '<?xml version="1.0" encoding="utf-8" ?>' + 122 '<?xml version="1.0" encoding="utf-8" ?>' + 146 '<?xml version="1.0" encoding="utf-8" ?>' + 168 '<?xml version="1.0" encoding="UTF-8" ?>' + 212 '<?xml version="1.0" encoding="UTF-8" ?>' + 233 '<?xml version="1.0" encoding="UTF-8" ?>' +
|
| D | XmlPullParserTest2.ets | 55 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 79 "{ : <?xml verion=\"1.0\" encoding=\"utf-8\"?> }", 107 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 131 "{ : <?xml verion=\"1.0\" encoding=\"utf-8\"?> }", 155 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 180 "{ : <?xml verion=\"1.0\" encoding=\"utf-8\"?> }", 207 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 237 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 281 …"<?xml version='1.0' encoding=\"utf-8\"?><!DOCTYPE example [<!ENTITY exampleEntity 'some entity'>]… 305 '<?xml version="1.0" encoding="utf-8"?>' + [all …]
|
| D | XmlPullParserTest10.ets | 50 '<?xml version="1.0" encoding="utf-8" ?>' + 73 '<?xml version="1.0" encoding="UTF-8" ?>' + 100 '<?xml version="1.0" encoding="UTF-8" ?>' + 134 '<?xml version="1.0" encoding="UTF-8" ?>' + 167 '<?xml version="1.0" encoding="UTF-8" ?>' + 200 '<?xml version="1.0" encoding="UTF-8" ?>' + 230 '<?xml version="1.0" encoding="UTF-8" ?>' + 260 '<?xml version="1.0" encoding="UTF-8" ?>' + 287 '<?xml version="1.0" encoding="UTF-8" ?>' + 311 'xml version="1.0" encoding="utf-8"' +
|
| D | XmlPullParserTest7.ets | 35 …"<?xml version='1.0' encoding=\"utf-8\"?><!DOCTYPE example [<!ENTITY exampleEntity 'some entity'>]… 72 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 102 "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE note [\n<!ENTITY foo \"baa\">]>", 133 "<?xml version=\"1.0\" encoding=\"utf-8\"?>", 167 "<?xml version=\"1.0\" encoding=\"utf-8\"?>", 198 let strXml = '<?xml version="1.0" encoding="utf-8"?>' + 222 let strXml = '<?xml version="1.0" encoding="utf-8"?>' + 269 '<?xml version="1.0" encoding="utf-8"?>' + 292 '<?xml version="1.0" encoding="utf-8"?>' +
|
| /arkcompiler/runtime_core/static_core/plugins/ets/sdk/native/api/ |
| D | ani_textencoder.cpp | 37 UConverterWrapper::UConverterWrapper(const char *encodingStr) : encoding(encodingStr) in UConverterWrapper() 40 converter = ucnv_open(encoding, &codeflag); in UConverterWrapper() 43 …LOG_ERROR_SDK("ncnv_open failed with encoding '%s' and error '%s'.", encodingStr, u_errorName(code… in UConverterWrapper() 121 …G_ERROR_SDK("TextEncoder:: Failure when converting to encoding %{public}s%{public}s", cvt.encoding, in OtherEncode() 199 … const std::string &encoding, char *dest, size_t destSizeBytes) in WriteEncodedData() argument 201 if (encoding == "utf-8") { in WriteEncodedData() 220 if (encoding == "utf-16le" || encoding == "utf-16be") { in WriteEncodedData() 232 if (encoding == "utf-16be") { in WriteEncodedData() 244 UConverterWrapper cvt(encoding.c_str()); in WriteEncodedData() 304 std::string encoding = stdlib::ConvertFromAniString(env, encodingObj); in DoEncodeIntoUint8Array() local [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/ |
| D | ArrayBuffer.ets | 310 * Creates a new ArrayBuffer from a string using the specified encoding. 312 * This native method encodes the given string using the provided encoding and creates an 317 * @param {string} encoding - The encoding to use for converting the string. 321 public static native from(str: string, encoding: string): ArrayBuffer; 369 …rayBuffer from an object, interpreting the second parameter as either a byte offset or an encoding. 372 …* parameters for string conversion (using the specified encoding and length). If the object is an … 377 …* if `obj` is a string, this is the encoding to us… 403 * Returns the number of bytes required to encode a given string using the specified encoding. 406 … * specified character encoding. Note that the byte length may differ from the number of characters 410 * @param {string} encoding - The encoding used to convert the string to bytes. [all …]
|
| /arkcompiler/runtime_core/static_core/docs/ |
| D | rationale-for-bytecode.md | 43 ## Encoding operands 113 encoding more compact. 122 accumulator, reducing performance and increasing encoding size). 129 which also saves us encoding space and improves performance 158 into 4 bits, we have to use a wider encoding: 165 How to make sure that we benefit from the shorter encoding most of the time? An observation shows 173 needed forms. Thus we save on opcode space without losing in encoding size (on average). 180 applications (thus we again save encoding space).
|
| /arkcompiler/runtime_core/docs/ |
| D | rationale-for-bytecode.md | 43 ## Encoding operands 113 encoding more compact. 122 accumulator, reducing performance and increasing encoding size). 129 which also saves us encoding space and improves performance 158 into 4 bits, we have to use a wider encoding: 165 How to make sure that we benefit from the shorter encoding most of the time? An observation shows 173 needed forms. Thus we save on opcode space without losing in encoding size (on average). 180 applications (thus we again save encoding space).
|
| /arkcompiler/runtime_core/static_core/tests/tests-u-runner-2/runner/code_coverage/ |
| D | coverage.py | 52 return subprocess.Popen(encoding=sys.stdout.encoding, **kwargs) 116 "a", encoding="utf-8") as the_file: 154 "w", encoding="utf-8") as file_dot_info: 158 "w", encoding="utf-8") as file_dot_json:
|
| /arkcompiler/ets_runtime/ecmascript/tests/ |
| D | concurrent_sweep_test.cpp | 32 EcmaStringAccessor::CreateFromUtf8(instance, utf8, 4, true)); // 4 : utf8 encoding length in TEST_F() 37 EcmaStringAccessor::CreateFromUtf8(instance, utf8, 4, true)); // 4 : utf8 encoding length in TEST_F()
|
| /arkcompiler/ets_frontend/ets2panda/linter/test/sdkwhite/ |
| D | quoted_hyphen_props_deprecated_sdk2.ets | 28 'content-encoding', 92 'content-encoding': 'UTF-8', // Error 107 'content-encoding': 'application/json', // Error
|
| D | quoted_hyphen_props_deprecated_sdk.ets | 57 'accept-encoding': 'gzip, deflate', // Error 139 'accept-encoding', 152 'content-encoding': '' // Error 195 'content-encoding': 'application/json', //Error
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/xml/XmlDynamicSerializer/ |
| D | XmlDynamicSerializerSetNamespaceTest.ets | 35 …let result = '<?xml version="1.0" encoding="utf-8"?>\r\n<h:note xmlns:h="http://www.w3.org/TR/html… 54 …let result = '<?xml version="1.0" encoding="utf-8"?>\r\n<b:note a="1" xmlns:b="http://www.w3.org/T… 73 …let result = '<?xml version="1.0" encoding="utf-8"?>\r\n<h:note1 xmlns:h="http://www.w3.org/TR/htm…
|
| D | XmlDynamicSerializerSetDeclarationAndBoundaryValueTest.ets | 21 … suite.addTest('Testing XML declaration with utf-8 encoding.', testXMLDeclarationWithUtf8Encoding); 31 let result = '<?xml version="1.0" encoding="utf-8"?>';
|