| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ec998be commit 8f5fd2f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -425,7 +425,11 @@ void ConverterObject::Create(const FunctionCallbackInfo<Value>& args) { | |||
| 425 | 425 | nullptr, nullptr, nullptr, &status); | |
| 426 | 426 | } | |
| 427 | 427 | ||
| 428 | - new ConverterObject(env, obj, conv, flags); | ||
| 428 | + auto converter = new ConverterObject(env, obj, conv, flags); | ||
| 429 | + size_t sublen = ucnv_getMinCharSize(conv); | ||
| 430 | + std::string sub(sublen, '?'); | ||
| 431 | + converter->set_subst_chars(sub.c_str()); | ||
| 432 | + | ||
| 429 | 433 | args.GetReturnValue().Set(obj); | |
| 430 | 434 | } | |
| 431 | 435 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -199,3 +199,10 @@ if (common.hasIntl) { | |||
| 199 | 199 | const str = decoder.decode(chunk); | |
| 200 | 200 | assert.strictEqual(str, 'foo\ufffd'); | |
| 201 | 201 | } | |
| 202 | + | ||
| 203 | + if (common.hasIntl) { | ||
| 204 | + const decoder = new TextDecoder('Shift_JIS'); | ||
| 205 | + const chunk = new Uint8Array([-1]); | ||
| 206 | + const str = decoder.decode(chunk); | ||
| 207 | + assert.strictEqual(str, '\ufffd'); | ||
| 208 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments