Code: Select all
#include <wx/string.h>
int main() {
wxPuts(wxT("García")); // Displays "Garc?a"
return 0;
}
Thanks.
Code: Select all
#include <wx/string.h>
int main() {
wxPuts(wxT("García")); // Displays "Garc?a"
return 0;
}
The problem is probably the encoding of the source file (main.cpp or what you're calling it)! You should save in with the encoding Unicode (UTF-8 with signature) !Joelito wrote:This is my current code to test my problem:How can I print the correct string: "García"?Code: Select all
#include <wx/string.h> int main() { wxPuts(wxT("García")); // Displays "Garc?a" return 0; }
Thanks.
Code: Select all
wxPuts(_("García"));
Code: Select all
wxT(" Non-english character : \u00FC")
Code: Select all
system("chcp 1252");
_setmbcp(1252);
printf("García");
system("pause");