File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -496,8 +496,7 @@ var LibraryEmbind = {
496
496
name = readLatin1String ( name ) ;
497
497
var stdStringIsUTF8
498
498
#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 ;
501
500
#else
502
501
= false ;
503
502
#endif
@@ -511,6 +510,7 @@ var LibraryEmbind = {
511
510
var payload = value + { { { POINTER_SIZE } } } ;
512
511
513
512
var str ;
513
+ #if EMBIND_STD_STRING_IS_UTF8
514
514
if ( stdStringIsUTF8 ) {
515
515
var decodeStartPtr = payload ;
516
516
// Looping here to support possible embedded '0' bytes
@@ -528,13 +528,15 @@ var LibraryEmbind = {
528
528
decodeStartPtr = currentBytePtr + 1 ;
529
529
}
530
530
}
531
+ #else
531
532
} else {
532
533
var a = new Array ( length ) ;
533
534
for ( var i = 0 ; i < length ; ++ i ) {
534
535
a [ i ] = String . fromCharCode ( HEAPU8 [ payload + i ] ) ;
535
536
}
536
537
str = a . join ( '' ) ;
537
538
}
539
+ #endif
538
540
539
541
_free ( value ) ;
540
542
You can’t perform that action at this time.
0 commit comments