Illegal byte sequence for a wxStaticText Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Manatax
Knows some wx things
Knows some wx things
Posts: 37
Joined: Fri Feb 06, 2009 9:28 pm

Illegal byte sequence for a wxStaticText

Post by Manatax » Mon Feb 23, 2009 8:25 pm

I'm still rather new to this lib, and I'm having issues with this. If you check the code for that cpp the issue is with the static text... but I'm not really sure how to fix it. Thanks all for the time used on reading and hopefully the time used to answer me. :D

Error:

Code: Select all

..\Tesis\ErrorPass.cpp|26|converting to execution character set: Illegal byte sequence|
ErrorPass.cpp:

Code: Select all

#include "ErrorPass.h"

//(*InternalHeaders(ErrorPass)
#include <wx/font.h>
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(ErrorPass)
const long ErrorPass::ID_STATICTEXT = wxNewId();
const long ErrorPass::ID_Aceptar = wxNewId();
const long ErrorPass::ID_PANEL = wxNewId();
//*)

BEGIN_EVENT_TABLE(ErrorPass,wxDialog)
	//(*EventTable(ErrorPass)
	//*)
END_EVENT_TABLE()

ErrorPass::ErrorPass(wxWindow* parent)
{
	//(*Initialize(ErrorPass)
	Create(parent, wxID_ANY, _("Login"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
	SetClientSize(wxSize(308,102));
	Panel = new wxPanel(this, ID_PANEL, wxPoint(0,0), wxSize(308,102), wxTAB_TRAVERSAL, _T("ID_PANEL"));
	StaticText = new wxStaticText(Panel, ID_STATICTEXT, _("El nombre de usuario o contraseña es incorrecto. Precione \"Aceptar\" para intentarlo nuevamente."), wxPoint(16,16), wxSize(272,48), wxST_NO_AUTORESIZE, _T("ID_STATICTEXT"));
	wxFont StaticTextFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Verdana"),wxFONTENCODING_DEFAULT);
	StaticText->SetFont(StaticTextFont);
	Aceptar = new wxButton(Panel, ID_Aceptar, _("Aceptar"), wxPoint(208,72), wxDefaultSize, 0, wxDefaultValidator, _T("ID_Aceptar"));
	Aceptar->SetDefault();

	Connect(ID_Aceptar,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ErrorPass::OnAceptarClick);
	//*)
}

ErrorPass::~ErrorPass()
{
	//(*Destroy(ErrorPass)
	//*)
}

void ErrorPass::OnAceptarClick(wxCommandEvent& event)
{

}
"If it ain't broken... give it a little more time... it will break eventually..."

computerquip
Experienced Solver
Experienced Solver
Posts: 72
Joined: Fri Feb 20, 2009 7:13 pm
Location: $(#wx)\src

Post by computerquip » Mon Feb 23, 2009 9:17 pm

converting to execution character set: Illegal byte sequence

Code: Select all

StaticText = new wxStaticText(Panel, ID_STATICTEXT, _("El nombre de usuario o contraseña es incorrecto. Precione "Aceptar" para intentarlo nuevamente."), wxPoint(16,16), wxSize(272,48), wxST_NO_AUTORESIZE, _T("ID_STATICTEXT"));
Without you telling me where to look, I can tell that your problem is here..The error message signals use of illegal characters that are unable to convert to the used format.

Code: Select all

ñ
Temporarily get rid of this character and your code should work.

This problem is not specific to wxWidgets. I found on the first Google of the error that you need to set the file type to use the ISO Latin standard to be able to use the Latin symbols.

Manatax
Knows some wx things
Knows some wx things
Posts: 37
Joined: Fri Feb 06, 2009 9:28 pm

Post by Manatax » Mon Feb 23, 2009 9:39 pm

Thx dude! :D
"If it ain't broken... give it a little more time... it will break eventually..."

Post Reply