converting MultiByteToWideChar (ofSystemTextBoxDialog in windows is not ut8)

hey, anybody knows how to convert the result of ofSystemTextBoxDialog in windows to a utf8 string? or something readable from fontStash ?

I noticed that ofSystemTextBoxDialog is using GetDlgItemTextA instead of GetDlgItemTextW
so this means it gets the string as ANSI instead of unicode.

what this means is : Good luck to you if you are passing a non English text on the dialog… (on a PC)

I tried to pass the returned string of ofSystemTextBoxDialog in FONTSTASH (PC) but it doesn’t print anything.

so I think I need to convert the string from ANSI to UNICODE and then back again

hope this makes sense… any idias on this issue?
I am not by any means an expert on text encoding …so I apologize if I wrote something inaccurate in the above text!

hi OF lovers,

So here is how we deal with this issue:

open the function in systemUtils.cpp

Remove this 2 lines:

char buf[16384];
GetDlgItemTextA( dialog, 101, buf, 16384 );

and replacethem with:

                wchar_t wstr[16384];  
		 GetDlgItemTextW( dialog, 101, wstr, 16384 );  
		  char mbstr2[16384];  
		 text = mbstr2;  

This allows the textbox to grab both english and non ???h

then what we do is converting wchar // to UNICODE multibyte


then passing it to our text string.