mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	[lit] Parse all strings as UTF-8 rather than ASCII.
As far as I can tell UTF-8 has been supported since the beginning of Python's codec support, and it's the de facto standard for text these days, at least for primarily-English text. This allows us to put Unicode into lit RUN lines. rdar://problem/18311663 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -156,13 +156,18 @@ def executeCommand(command, cwd=None, env=None): | ||||
|     if exitCode == -signal.SIGINT: | ||||
|         raise KeyboardInterrupt | ||||
|  | ||||
|     def to_string(bytes): | ||||
|         if isinstance(bytes, str): | ||||
|             return bytes | ||||
|         return bytes.encode('utf-8') | ||||
|  | ||||
|     # Ensure the resulting output is always of string type. | ||||
|     try: | ||||
|         out = str(out.decode('ascii')) | ||||
|         out = to_string(out.decode('utf-8')) | ||||
|     except: | ||||
|         out = str(out) | ||||
|     try: | ||||
|         err = str(err.decode('ascii')) | ||||
|         err = to_string(err.decode('utf-8')) | ||||
|     except: | ||||
|         err = str(err) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user