|  | @@ -67,15 +67,16 @@ def winGetClipboard():
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  def winSetClipboard(text):
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  |      GMEM_DDESHARE = 0x2000
 | 
	
		
			
				|  |  |      ctypes.windll.user32.OpenClipboard(0)
 | 
	
		
			
				|  |  |      ctypes.windll.user32.EmptyClipboard()
 | 
	
		
			
				|  |  |      hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE,
 | 
	
		
			
				|  |  | -                                                 len(bytes(text, 'ascii'))+1)
 | 
	
		
			
				|  |  | +                                                 len(bytes(text))+1)
 | 
	
		
			
				|  |  |      pchData = ctypes.windll.kernel32.GlobalLock(hCd)
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +    ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData), bytes(text))
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  | -    ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData),
 | 
	
		
			
				|  |  | -                              text.decode())
 | 
	
		
			
				|  |  |      ctypes.windll.kernel32.GlobalUnlock(hCd)
 | 
	
		
			
				|  |  |      ctypes.windll.user32.SetClipboardData(1, hCd)
 | 
	
		
			
				|  |  |      ctypes.windll.user32.CloseClipboard()
 |