File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments