mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	utf8proc bits for utf8_fromwc.
This commit is contained in:
		
							
								
								
									
										5
									
								
								utf8.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								utf8.c
									
									
									
									
									
								
							@@ -24,6 +24,7 @@
 | 
				
			|||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <wchar.h>
 | 
					#include <wchar.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "compat.h"
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const wchar_t utf8_force_wide[] = {
 | 
					static const wchar_t utf8_force_wide[] = {
 | 
				
			||||||
@@ -455,7 +456,11 @@ utf8_fromwc(wchar_t wc, struct utf8_data *ud)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	int	size, width;
 | 
						int	size, width;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_UTF8PROC
 | 
				
			||||||
 | 
						size = utf8proc_wctomb(ud->data, wc);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
	size = wctomb(ud->data, wc);
 | 
						size = wctomb(ud->data, wc);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	if (size < 0) {
 | 
						if (size < 0) {
 | 
				
			||||||
		log_debug("UTF-8 %d, wctomb() %d", wc, errno);
 | 
							log_debug("UTF-8 %d, wctomb() %d", wc, errno);
 | 
				
			||||||
		wctomb(NULL, 0);
 | 
							wctomb(NULL, 0);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user