Skip to content

Commit 3acc4b3

Browse files
tniessenmhdawson
authored andcommitted
Fix std::string encoding (#619)
1. "ANSI" is misleading and not a good description of any string encoding. It is commonly used to refer to "Windows code pages" such as Windows-125x, but these code pages have never been standardized by ANSI. 2. It is wrong, we treat std::string as UTF8. PR-URL: #619 Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent e71d0ea commit 3acc4b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Napi::String::New(napi_env env, const char16_t* value, size_t length);
6262
6363
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Value` object.
6464
- `[in] value`: The C++ primitive from which to instantiate the `Napi::Value`. `value` may be any of:
65-
- `std::string&` - represents an ANSI string.
65+
- `std::string&` - represents a UTF8 string.
6666
- `std::u16string&` - represents a UTF16-LE string.
6767
- `const char*` - represents a UTF8 string.
6868
- `const char16_t*` - represents a UTF16-LE string.

doc/symbol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Napi::Symbol::New(napi_env env, napi_value description);
2323
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Symbol` object.
2424
- `[in] value`: The C++ primitive which represents the description hint for the `Napi::Symbol`.
2525
`description` may be any of:
26-
- `std::string&` - ANSI string description.
26+
- `std::string&` - UTF8 string description.
2727
- `const char*` - represents a UTF8 string description.
2828
- `String` - Node addon API String description.
2929
- `napi_value` - N-API `napi_value` description.

0 commit comments

Comments
 (0)