Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » charset conversion
charset conversion [message #26011] Thu, 25 March 2010 19:20 Go to previous message
abductee is currently offline  abductee
Messages: 22
Registered: June 2007
Location: Germany
Promising Member
hi,
ich have the problem that stuff i derive from a line edit seems to be utf8, but i'd like to have it in unicode... can't i tell string shomehow easly to reencode itself?
( because it breaks german "umlauts" )

a littele example to show the problem:

#include <CtrlLib/CtrlLib.h>
#include <windows.h>

using namespace Upp;
struct MyAppWindow : TopWindow {
    Button button;
    LineEdit ed;
    void Click() { 
    		String s = ~ed;
		const char *t = s;
		MessageBox(0,t,"text as char",MB_OK);
    }
    typedef MyAppWindow CLASSNAME;
    MyAppWindow() {
        Title("My application with button");
	Add(ed.TopPos(20,100).LeftPos(100,100));
        Add(button.LeftPos(100, 100).TopPos(120, 30));
        button.SetLabel("Render Text");
	Sizeable();
        button <<= THISBACK(Click);
    }
};


GUI_APP_MAIN
{
    MyAppWindow app;
    app.Run();
}



p.s.: please don't tell me to use PromtOK insted of MessageBox, this is just en example to illustrate the problem Smile

index.php?t=getfile&id=2436&private=0
  • Attachment: conv.jpg
    (Size: 20.33KB, Downloaded 502 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CParser enhancements
Next Topic: Xmlize hates spaces
Goto Forum:
  


Current Time: Wed May 14 12:06:21 CEST 2025

Total time taken to generate the page: 0.03446 seconds