8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbcc962 commit b0f09a2Copy full SHA for b0f09a2
doc/api/n-api.md
@@ -1462,51 +1462,51 @@ The JavaScript Number type is described in
1462
[Section 6.1.6](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type)
1463
of the ECMAScript Language Specification.
1464
1465
-#### *napi_create_string_utf16*
+#### *napi_create_string_latin1*
1466
<!-- YAML
1467
added: v8.0.0
1468
-->
1469
```C
1470
-napi_status napi_create_string_utf16(napi_env env,
1471
- const char16_t* str,
1472
- size_t length,
1473
- napi_value* result)
+NAPI_EXTERN napi_status napi_create_string_latin1(napi_env env,
+ const char* str,
+ size_t length,
+ napi_value* result);
1474
```
1475
1476
- `[in] env`: The environment that the API is invoked under.
1477
-- `[in] str`: Character buffer representing a UTF16-LE-encoded string.
1478
-- `[in] length`: The length of the string in two-byte code units, or -1 if
1479
-it is null-terminated.
+- `[in] str`: Character buffer representing a ISO-8859-1-encoded string.
+- `[in] length`: The length of the string in bytes, or -1 if it is
+null-terminated.
1480
- `[out] result`: A `napi_value` representing a JavaScript String.
1481
1482
Returns `napi_ok` if the API succeeded.
1483
1484
-This API creates a JavaScript String object from a UTF16-LE-encoded C string
+This API creates a JavaScript String object from a ISO-8859-1-encoded C string.
1485
1486
The JavaScript String type is described in
1487
[Section 6.1.4](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type)
1488
1489
1490
-#### *napi_create_string_latin1*
+#### *napi_create_string_utf16*
1491
1492
1493
1494
1495
-NAPI_EXTERN napi_status napi_create_string_latin1(napi_env env,
1496
- const char* str,
1497
1498
- napi_value* result);
+napi_status napi_create_string_utf16(napi_env env,
+ const char16_t* str,
+ napi_value* result)
1499
1500
1501
1502
-- `[in] str`: Character buffer representing a latin1-encoded string.
1503
-- `[in] length`: The length of the string in bytes, or -1 if it is
1504
-null-terminated.
+- `[in] str`: Character buffer representing a UTF16-LE-encoded string.
+- `[in] length`: The length of the string in two-byte code units, or -1 if
+it is null-terminated.
1505
1506
1507
1508
1509
-This API creates a JavaScript String object from a latin1-encoded C string.
+This API creates a JavaScript String object from a UTF16-LE-encoded C string
1510
1511
1512
@@ -1795,6 +1795,33 @@ is passed in it returns `napi_number_expected`.
1795
This API returns the C int64 primitive equivalent of the given
1796
JavaScript Number
1797
1798
+#### *napi_get_value_string_latin1*
1799
+<!-- YAML
1800
+added: v8.0.0
1801
+-->
1802
+```C
1803
+NAPI_EXTERN napi_status napi_get_value_string_latin1(napi_env env,
1804
+ napi_value value,
1805
+ char* buf,
1806
+ size_t bufsize,
1807
+ size_t* result)
1808
+```
1809
+
1810
+- `[in] env`: The environment that the API is invoked under.
1811
+- `[in] value`: `napi_value` r 10000 epresenting JavaScript string.
1812
+- `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If NULL is
1813
+passed in, the length of the string (in bytes) is returned.
1814
+- `[in] bufsize`: Size of the destination buffer.
1815
+- `[out] result`: Number of bytes copied into the buffer including the null
1816
+terminator. If the buffer size is insufficient, the string will be truncated
1817
+including a null terminator.
1818
1819
+Returns `napi_ok` if the API succeeded. If a non-String `napi_value`
1820
+is passed in it returns `napi_string_expected`.
1821
1822
+This API returns the ISO-8859-1-encoded string corresponding the value passed
1823
+in.
1824
1825
#### *napi_get_value_string_utf8*
1826
1827
@@ -1810,14 +1837,14 @@ napi_status napi_get_value_string_utf8(napi_env env,
1837
1838
- `[in] value`: `napi_value` representing JavaScript string.
1839
- `[in] buf`: Buffer to write the UTF8-encoded string into. If NULL is passed
- in, the length of the string (in bytes) is returned.
1840
+in, the length of the string (in bytes) is returned.
1841
- `[in] bufsize`: Size of the destination buffer.
-- `[out] result`: Number of bytes copied into the buffer including the null.
1842
1843
terminator. If the buffer size is insufficient, the string will be truncated
1844
including a null terminator.
1845
-Returns `napi_ok` if the API succeeded. Ifa non-String `napi_value`
-x is passed in it returns `napi_string_expected`.
1846
1847
1848
1849
This API returns the UTF8-encoded string corresponding the value passed in.
1850
@@ -1839,7 +1866,7 @@ napi_status napi_get_value_string_utf16(napi_env env,
1866
passed in, the length of the string (in 2-byte code units) is returned.
1867
1868
- `[out] result`: Number of 2-byte code units copied into the buffer including
-the null terminateor. If the buffer size is insufficient, the string will be
1869
+the null terminator. If the buffer size is insufficient, the string will be
1870
truncated including a null terminator.
1871
1872
Returns `napi_ok` if the API succeeded. If a non-String `napi_value`