On Monday, 16 March 2015 at 13:33:55 UTC, Robert burner Schadek
wrote:
... from all Unicode characters in an idiomatic D way? (std.interal.unicode_*)

```
T genUnicodeString(T)(size_t minChars, size_t maxChars) if(isSomeString!T) {
    ...
}
```

You'll need two things. A uniform distribution of { 0 ... 113,020
}, this should be easy using phobos. And a mapping of { 0 ...
113,020 } -> unicode ( or UTFX directly ). Since the unicode
planes or not connected, this might involve some kind of table.

Then just generate your uniform distribution and apply the
mapping.

Reply via email to