From d6117e33d0f1c888903c7813afbf8dd45432c53a Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 15 Jul 2015 22:14:04 -0600 Subject: [PATCH] AddInputCharactersUTF8: shallow tweaks (#274) --- imgui.cpp | 14 ++++++-------- imgui.h | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 6083fa4d..25099174 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -778,16 +778,14 @@ void ImGuiIO::AddInputCharacter(ImWchar c) } } -void ImGuiIO::AddInputCharactersUTF8(const char* utf8chars) +void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars) { - // we can't pass more wchars than ImGuiIO::InputCharacters[] can hold so don't convert more - static const int wcharBufLen = sizeof(ImGuiIO::InputCharacters)/sizeof(ImWchar); - ImWchar wchars[wcharBufLen]; - ImTextStrFromUtf8(wchars, wcharBufLen, utf8chars, NULL); - for(int i=0; i