mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-11-04 00:27:23 +01:00 
			
		
		
		
	pbot-vm: escape malformed Unicode on STDOUT
This commit is contained in:
		
							parent
							
								
									110912e85d
								
							
						
					
					
						commit
						1c57e01fad
					
				@ -316,6 +316,10 @@ sub execute {
 | 
			
		||||
 | 
			
		||||
        if ($line =~ /^result:/) {
 | 
			
		||||
            $line =~ s/^result://;
 | 
			
		||||
 | 
			
		||||
            my $octets = decode('UTF-8', $line, sub { sprintf '\\\\x%X', shift });
 | 
			
		||||
            $line = encode('UTF-8', $octets, Encode::FB_CROAK);
 | 
			
		||||
 | 
			
		||||
            my $compile_out = decode_json($line);
 | 
			
		||||
            $result .= "$compile_out->{result}\n";
 | 
			
		||||
            $got_result = 1;
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,7 @@ use PBot::Imports;
 | 
			
		||||
# These are set by the /misc/update_version script
 | 
			
		||||
use constant {
 | 
			
		||||
    BUILD_NAME     => "PBot",
 | 
			
		||||
    BUILD_REVISION => 4525,
 | 
			
		||||
    BUILD_REVISION => 4526,
 | 
			
		||||
    BUILD_DATE     => "2022-04-04",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user