Home » U++ Library support » U++ Core » charset conversion
charset conversion [message #26011] |
Thu, 25 March 2010 19:20  |
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 
-
Attachment: conv.jpg
(Size: 20.33KB, Downloaded 502 times)
|
|
|
Goto Forum:
Current Time: Wed May 14 14:54:31 CEST 2025
Total time taken to generate the page: 0.04200 seconds
|