View previous topic :: View next topic |
Author |
Message |
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Thu Dec 15, 2005 2:05 pm Post subject: Simple UTF functions |
|
|
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 |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Thu Dec 15, 2005 2:23 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|
|
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
|