Page 1 of 1

Pango-WARNING **: Invalid UTF-8 string passed to pango_layou

Posted: Sat Feb 10, 2007 4:17 pm
by krisje8
I get the error in Konsole when I run my program, and I get a very large blank 'popup'.
I know it's in this piece of code somewhere:

Code: Select all

void IntraMsg2Frm::WxButton1Click(wxCommandEvent& event)
{
	// -+-+-+- SENDKNOP !!!! -+-+-+-

    char argument[1073];
    const char *aan = WxEdit1->GetValue().mb_str(wxConvUTF8); 	// Idem, maar nu voor aan.
    const char *bericht = Message->GetValue().mb_str(wxConvUTF8); //De inhoud van het berichtvakje                             		//is nu aan de char bericht gegeven.

    #if defined(__WINDOWS__)
       sprintf (argument,"NET SEND %s %s",aan,bericht);
       system(argument);
    #endif

    #if defined(__LINUX__)
       sprintf (argument,"echo \"%s\" | smbclient -M %s",bericht,aan);
       system(argument);

       wxString linmsg;
       linmsg.Printf(_T("even testen of ie linux wel herkent\n")
       		     _T("Dan hier ook maar ff het argument: \n %s")
		     _T("aan testen:\n %s")
		     _T("bericht testen:\n %s"), argument, aan, bericht );
		     wxMessageBox(linmsg,_T("Argument check op linux"), wxOK | wxICON_INFORMATION, this);
    #endif


}
What do I do wrong?

P.S.: My system is Sabayon (Gentoo) Linux .

Posted: Sun Feb 11, 2007 2:35 am
by Ryan Norton
Maybe mb_str is the issue - in unicode builds it returns wxCharBuffer, and in ANSI the calls you make will do nothing (i.e. just the same as c_str). So, you should probably just be calling c_str instead and making sure the compilation is right; or, if you need utf8 youll need a roundtrip conversion in ANSI mode by calling wc_str with wxConvLocal and then converting it to utf8 via wxConvUTF8.cWC2MB.

Let me know if that helps :D.

Posted: Sun Feb 11, 2007 10:55 am
by krisje8
Ok, I changed it in this:

Code: Select all

const char *aan = WxEdit1->GetValue().wc_str(wxConvLocal); 	// Idem, maar nu voor aan.
    const char *bericht = Message->GetValue().wc_str(wxConvLocal); //De inhoud van het berichtvakje                             		//is nu aan de char bericht gegeven.
But now I get this error while compiling:

[quote][email protected] ~/IntraMsg2_1 $ g++ *.cpp `wx-config --libs --cxxflags` -o IntraMsg2
IntraMsg2Frm.cpp: In member function