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

Simple UTF functions

 
Post new topic   Reply to topic     Forum Index -> Ares
View previous topic :: View next topic  
Author Message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Thu Dec 15, 2005 2:05 pm    Post subject: Simple UTF functions Reply with quote

As you know, I'm planning to add Kris' port of ICU as an addon module, but Ares really needs some basic UTF conversion functionality of its own. For lack of anything better, I resurrected the module I adapted for readf this morning and looked it over. Link to a sparse DDoc about it is here:

http://home.f4.ca/sean/d/utf.html

It's basically the same as std.utf in Phobos, but with some added functions which accept a delegate instead of an inout string parameter. There is a version that returns true/false on failure (for streamlined IO use), while the others all throw an exception instead.

I'd like some input on this module before I submit it to Ares, as I'm still somewhat of a UTF novice. Is it sufficient for basic UTF conversions? Is it too much? How about the interface? I'm aiming for something that's useful for most "common" situations so only those interested in serious work have to link against ICU, as ICU has a rather large footprint. At the same time, I don't want to duplicate too much functionality or provide features that won't be of much use. What does everyone think?

By the way, I like that this trick is possible with std.utf:

dchar [] d = "blah";
char[] c = d.toUTF8();

Gotta love implicit properties for array types Smile
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Thu Dec 15, 2005 2:23 pm    Post subject: Reply with quote

Alternately, mango.convert.Unicode does essentially the same thing (minus the delegate methods). In some respects I like the Mango version better, but I don't much want to start grabbing Mango code just because I like it Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Ares 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