FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unicode

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Thu Jun 01, 2006 8:55 pm    Post subject: Unicode Reply with quote

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 Smile

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Fri Jun 02, 2006 10:33 am    Post subject: Re: Unicode Reply with quote

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
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Sat Jun 03, 2006 5:38 pm    Post subject: Reply with quote

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 ĉ. Sad

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Sat Jun 03, 2006 6:38 pm    Post subject: Reply with quote

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 Idea
Back to top
View user's profile Send private message
asterite



Joined: 01 Jun 2006
Posts: 235
Location: Buenos Aires, Argentina

PostPosted: Sat Jun 03, 2006 7:26 pm    Post subject: Reply with quote

Yeaaaaaaah! It worked with the snapshot!

And also that applications that converts "cx" to ĉ works in the control.

Thanks a lot!! Very Happy Very Happy Very Happy
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group