dstring 1.0
October 12th, 2006 | by Aldacron |Chris Miller has released a module that provides an alternative wrapper to D’s built-in strings: dstring. If you are wondering what possible use this could server, here’s an excerpt from the dstring FAQ:
Why change the char type like this?There are three main reasons for this.
1) It makes slicing and indexing very easy and efficient. It is no longer possible to index or slice resulting in an invalid UTF sequence.
2) Some languages fit very well in UTF-8 and some fit even worse than the extra space per codepoint of UTF-16; with this string implementation, this space problem is minimized.
3) This string implementation makes it easy to fully support every character supported by the Unicode standard. In many cases, people who are not aware of how UTF works will not support it properly and will break support with languages they did not anticipate their program would be used with.
#3 looks like a reason for me to use it. I hate dealing with Unicode. That’s one thing I’ve always liked about Java strings — most of the time you don’t have to worry about the encoding your String objects are working with. Read all about the dstring module, including the FAQ and module documentation, and download it at the dstring page.
Technorati Tags: D Programming Language, DMD, strings