Rune strings. Like in Go.
Alexey
invalid at email.address
Thu Sep 30 22:47:25 UTC 2021
On Thursday, 30 September 2021 at 20:57:34 UTC, Paul Backus wrote:
> On Thursday, 30 September 2021 at 20:44:54 UTC, Alexey wrote:
>> Can we have them in D? :)
>
> We have them already. :) What Go calls a "rune" is called a
> `dchar` in D, and a string of them is a `dchar[]`.
Go's runes and D's dchars - have different behavior.
Go's rune string, being converted to byte array like so
`[]byte(string_var)` and saved to file - results in UTF-8, while
dchar is UTF-32.
this means - the frequent conversions between string and dstring
in D is required for confortable work with unicode.
More information about the Digitalmars-d
mailing list