mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Fix Windows UTF16 char. (#538)
Windows output UTF16 unicode char, but FTXUI works using UTF8. Do the conversion. This resolves: https://github.com/ArthurSonzogni/FTXUI/issues/495
This commit is contained in:
		| @@ -26,6 +26,7 @@ | ||||
| #include "ftxui/component/terminal_input_parser.hpp"  // for TerminalInputParser | ||||
| #include "ftxui/dom/node.hpp"                         // for Node, Render | ||||
| #include "ftxui/dom/requirement.hpp"                  // for Requirement | ||||
| #include "ftxui/screen/string.hpp" | ||||
| #include "ftxui/screen/terminal.hpp"                  // for Size, Dimensions | ||||
|  | ||||
| #if defined(_WIN32) | ||||
| @@ -104,7 +105,11 @@ void EventListener(std::atomic<bool>* quit, Sender<Task> out) { | ||||
|           // ignore UP key events | ||||
|           if (key_event.bKeyDown == FALSE) | ||||
|             continue; | ||||
|           parser.Add((char)key_event.uChar.UnicodeChar); | ||||
|           std::wstring wstring; | ||||
|           wstring += key_event.uChar.UnicodeChar; | ||||
|           for(auto it : to_string(wstring)) { | ||||
|             parser.Add(it); | ||||
|           } | ||||
|         } break; | ||||
|         case WINDOW_BUFFER_SIZE_EVENT: | ||||
|           out->Send(Event::Special({0})); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Arthur Sonzogni
					Arthur Sonzogni