View previous topic :: View next topic |
Author |
Message |
asterite
Joined: 01 Jun 2006 Posts: 235 Location: Buenos Aires, Argentina
|
Posted: Thu Jun 01, 2006 8:55 pm Post subject: Unicode |
|
|
Hello.
First of all, I'm a super newbie in D and DFL.
I'm planning to build an application and I know I will need to use unicode in it (it will be in Esperanto). My problem is that I can't seem to make appear unicode text in a control (for example, in a textbox). I tried to modify the sample application "rich.d" by changing the text assigned to the RichTextBox in several ways ("\u0109", toUTF8("\u0109"w), "ĉ" and save the file as UTF8 with or without BOM -> none of them worked).
I think my problem is that I've never programmed in D before, and less in DFL
But I'm eager to do it, because I think both projects are awsome: it is really needed a powerful, clean, nice language that compiles to native code.
Thanks,
Ary |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Fri Jun 02, 2006 10:33 am Post subject: Re: Unicode |
|
|
It's working here; tested both setting the text and selectedText to "\u0109". Are you sure your font used supports this character? If you're using Windows 9x/Me, does your code page support this character?
- Chris |
|
Back to top |
|
|
asterite
Joined: 01 Jun 2006 Posts: 235 Location: Buenos Aires, Argentina
|
Posted: Sat Jun 03, 2006 5:38 pm Post subject: |
|
|
Thanks for the reply Chris.
I used Tahoma, and now proved Arial (both with and without bold) and it still shows me a "c" instead of a ĉ.
The code is as follows:
Code: | private import dfl.all, dfl.winapi;
int main() {
Form f;
RichTextBox rtb;
with(f = new Form) {
text = "RichTextBox";
}
with(rtb = new RichTextBox) {
text = "\u0109";
dock = DockStyle.FILL;
font = new Font("Arial", cast(float)12);
}
rtb.parent = f;
Application.run(f);
return 0;
} |
I'm using Windows XP.
Strange this is that if a copy a ĉ from a page to the RichTextBox, it works... (although an application I have, named Ek!, for converting "cx" to "ĉ" while typing dosen't work in that control, but in other applications, like Notepad, it works).
What could it be? |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Sat Jun 03, 2006 6:38 pm Post subject: |
|
|
I think I see the problem; the current DFL snapshot supports this, whereas DFL 0.9.2 does not. I'm using the snapshot and you probably are not |
|
Back to top |
|
|
asterite
Joined: 01 Jun 2006 Posts: 235 Location: Buenos Aires, Argentina
|
Posted: Sat Jun 03, 2006 7:26 pm Post subject: |
|
|
Yeaaaaaaah! It worked with the snapshot!
And also that applications that converts "cx" to ĉ works in the control.
Thanks a lot!! |
|
Back to top |
|
|
|