mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:32:44 +00:00 
			
		
		
		
	LibC: Implement a very naive mbtowc()
This just copies the short char into the wide char without any decoding whatsoever. A proper implementation should look at the current LC_CTYPE and implement multi-byte decoding.
This commit is contained in:
		
							parent
							
								
									680a873b76
								
							
						
					
					
						commit
						4f27745136
					
				
					 1 changed files with 14 additions and 2 deletions
				
			
		|  | @ -447,9 +447,21 @@ size_t mbstowcs(wchar_t*, const char*, size_t) | |||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
| 
 | ||||
| size_t mbtowc(wchar_t*, const char*, size_t) | ||||
| size_t mbtowc(wchar_t* wch, const char* data, size_t data_size) | ||||
| { | ||||
|     ASSERT_NOT_REACHED(); | ||||
|     // FIXME: This needs a real implementation.
 | ||||
|     UNUSED_PARAM(data_size); | ||||
| 
 | ||||
|     if (wch && data) { | ||||
|         *wch = *data; | ||||
|         return 1; | ||||
|     } | ||||
| 
 | ||||
|     if (!wch && data) { | ||||
|         return 1; | ||||
|     } | ||||
| 
 | ||||
|     return 0; | ||||
| } | ||||
| 
 | ||||
| int wctomb(char*, wchar_t) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling