Skip to content

Commit aac49df

Browse files
committed
Remove (name === "std::string")
1 parent 3954556 commit aac49df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/embind/embind.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ var LibraryEmbind = {
496496
name = readLatin1String(name);
497497
var stdStringIsUTF8
498498
#if EMBIND_STD_STRING_IS_UTF8
499-
//process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string<unsigned char>
500-
= (name === "std::string");
499+
= true;
501500
#else
502501
= false;
503502
#endif
@@ -511,6 +510,7 @@ var LibraryEmbind = {
511510
var payload = value + {{{ POINTER_SIZE }}};
512511

513512
var str;
513+
#if EMBIND_STD_STRING_IS_UTF8
514514
if (stdStringIsUTF8) {
515515
var decodeStartPtr = payload;
516516
// Looping here to support possible embedded '0' bytes
@@ -528,13 +528,15 @@ var LibraryEmbind = {
528528
decodeStartPtr = currentBytePtr + 1;
529529
}
530530
}
531+
#else
531532
} else {
532533
var a = new Array(length);
533534
for (var i = 0; i < length; ++i) {
534535
a[i] = String.fromCharCode(HEAPU8[payload + i]);
535536
}
536537
str = a.join('');
537538
}
539+
#endif
538540

539541
_free(value);
540542

0 commit comments

Comments
 (0)