mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
Code chars in data section directly and not escaped
This commit is contained in:
parent
371cde8c0e
commit
7bd7e82063
@ -167,7 +167,11 @@ public class TextModuleWriter extends ModuleWriter {
|
|||||||
textOutput.append( "(data (i32.const 0) \"" );
|
textOutput.append( "(data (i32.const 0) \"" );
|
||||||
byte[] data = dataStream.toByteArray();
|
byte[] data = dataStream.toByteArray();
|
||||||
for( byte b : data ) {
|
for( byte b : data ) {
|
||||||
textOutput.append( '\\' ).append( Character.forDigit( (b >> 4) & 0xF, 16 ) ).append( Character.forDigit( b & 0xF, 16 ) );
|
if( b >= ' ' && b < 0x7F && b != '\"' && b != '\\' ) {
|
||||||
|
textOutput.append( (char)b );
|
||||||
|
} else {
|
||||||
|
textOutput.append( '\\' ).append( Character.forDigit( (b >> 4) & 0xF, 16 ) ).append( Character.forDigit( b & 0xF, 16 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
textOutput.append( "\")" );
|
textOutput.append( "\")" );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user