@@ -2886,6 +2886,36 @@ string. The native string is copied.
2886
2886
The JavaScript `string` type is described in
2887
2887
[Section 6.1.4][] of the ECMAScript Language Specification.
2888
2888
2889
+ #### `node_api_create_external_string_latin1`
2890
+
2891
+ <!-- YAML
2892
+ added: REPLACEME
2893
+ -->
2894
+
2895
+ > Stability: 1 - Experimental
2896
+
2897
+ ```c
2898
+ napi_status node_api_create_string_latin1(napi_env env,
2899
+ const char* str,
2900
+ size_t length,
2901
+ napi_value* result);
2902
+ ```
2903
+
2904
+ * `[in] env`: The environment that the API is invoked under.
2905
+ * `[in] str`: Character buffer representing an ISO-8859-1-encoded string.
2906
+ * `[in] length`: The length of the string in bytes, or `NAPI_AUTO_LENGTH` if it
2907
+ is null-terminated.
2908
+ * `[out] result`: A `napi_value` representing a JavaScript `string`.
2909
+
2910
+ Returns `napi_ok` if the API succeeded.
2911
+
2912
+ This API creates a JavaScript `string` value from an ISO-8859-1-encoded C
2913
+ string. The native string may not be copied and must thus exist for the entire
2914
+ life cycle of the JavaScript value.
2915
+
2916
+ The JavaScript `string` type is described in
2917
+ [Section 6.1.4][] of the ECMAScript Language Specification.
2918
+
2889
2919
#### `napi_create_string_utf16`
2890
2920
2891
2921
<!-- YAML
@@ -2914,6 +2944,36 @@ The native string is copied.
2914
2944
The JavaScript `string` type is described in
2915
2945
[Section 6.1.4][] of the ECMAScript Language Specification.
2916
2946
2947
+ #### `node_api_create_external_string_utf16`
2948
+
2949
+ <!-- YAML
2950
+ added: REPLACEME
2951
+ -->
2952
+
2953
+ > Stability: 1 - Experimental
2954
+
2955
+ ```c
2956
+ napi_status node_api_create_string_utf16(napi_env env,
2957
+ const char16_t* str,
2958
+ size_t length,
2959
+ napi_value* result)
2960
+ ```
2961
+
2962
+ * `[in] env`: The environment that the API is invoked under.
2963
+ * `[in] str`: Character buffer representing a UTF16-LE-encoded string.
2964
+ * `[in] length`: The length of the string in two-byte code units, or
2965
+ `NAPI_AUTO_LENGTH` if it is null-terminated.
2966
+ * `[out] result`: A `napi_value` representing a JavaScript `string`.
2967
+
2968
+ Returns `napi_ok` if the API succeeded.
2969
+
2970
+ This API creates a JavaScript `string` value from a UTF16-LE-encoded C string.
2971
+ The native string may not be copied and must thus exist for the entire life
2972
+ cycle of the JavaScript value.
2973
+
2974
+ The JavaScript `string` type is described in
2975
+ [Section 6.1.4][] of the ECMAScript Language Specification.
2976
+
2917
2977
#### `napi_create_string_utf8`
2918
2978
2919
2979
<!-- YAML
@@ -2942,6 +3002,36 @@ The native string is copied.
2942
3002
The JavaScript `string` type is described in
2943
3003
[Section 6.1.4][] of the ECMAScript Language Specification.
2944
3004
3005
+ #### `node_api_create_external_string_utf8`
3006
+
3007
+ <!-- YAML
3008
+ added: REPLACEME
3009
+ -->
3010
+
3011
+ > Stability: 1 - Experimental
3012
+
3013
+ ```c
3014
+ napi_status node_api_create_string_utf8(napi_env env,
3015
+ const char* str,
3016
+ size_t length,
3017
+ napi_value* result)
3018
+ ```
3019
+
3020
+ * `[in] env`: The environment that the API is invoked under.
3021
+ * `[in] str`: Character buffer representing a UTF8-encoded string.
3022
+ * `[in] length`: The length of the string in bytes, or `NAPI_AUTO_LENGTH` if it
3023
+ is null-terminated.
3024
+ * `[out] result`: A `napi_value` representing a JavaScript `string`.
3025
+
3026
+ Returns `napi_ok` if the API succeeded.
3027
+
3028
+ This API creates a JavaScript `string` value from a UTF8-encoded C string.
3029
+ The native string may not be copied and must thus exist for the entire life
3030
+ cycle of the JavaScript value.
3031
+
3032
+ The JavaScript `string` type is described in
3033
+ [Section 6.1.4][] of the ECMAScript Language Specification.
3034
+
2945
3035
### Functions to convert from Node-API to C types
2946
3036
2947
3037
#### `napi_get_array_length`
0 commit comments