Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 11, 2018 I used to be able to use a bffer for toUTF operation, what happened ? | ||||
---|---|---|---|---|
| ||||
This used to be an option: dchar val = ...; char[4] buf; toUTF8(buf, val); Now I'm getting an error. Looking at the doc, it seems that there are only option returning a string, which I assume is allocated on the GC. Has the function moved somewhere else ? If not, what's going on ? |
April 11, 2018 Re: I used to be able to use a bffer for toUTF operation, what happened ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On Wednesday, 11 April 2018 at 12:04:24 UTC, deadalnix wrote:
> This used to be an option:
>
> dchar val = ...;
> char[4] buf;
> toUTF8(buf, val);
>
> Now I'm getting an error. Looking at the doc, it seems that there are only option returning a string, which I assume is allocated on the GC. Has the function moved somewhere else ? If not, what's going on ?
std.utf.encode ?
|
April 11, 2018 Re: I used to be able to use a bffer for toUTF operation, what happened ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On Wednesday, 11 April 2018 at 12:04:24 UTC, deadalnix wrote: > This used to be an option: > > dchar val = ...; > char[4] buf; > toUTF8(buf, val); > > Now I'm getting an error. This std.utf.toUTF8 overload was deprecated in 2.074.0 and finally removed in 2.077.0: https://run.dlang.io/is/O57AGU (click Run) Do you have deprecation messages turned on? |
April 11, 2018 Re: I used to be able to use a bffer for toUTF operation, what happened ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On Wednesday, 11 April 2018 at 12:41:24 UTC, Vladimir Panteleev wrote:
> On Wednesday, 11 April 2018 at 12:04:24 UTC, deadalnix wrote:
>> This used to be an option:
>>
>> dchar val = ...;
>> char[4] buf;
>> toUTF8(buf, val);
>>
>> Now I'm getting an error.
>
> This std.utf.toUTF8 overload was deprecated in 2.074.0 and finally removed in 2.077.0:
>
> https://run.dlang.io/is/O57AGU (click Run)
>
> Do you have deprecation messages turned on?
Yes, but I skipped a few version.
encode as proposed indeed does the job, so no problem.
Thanks everybody.
|
Copyright © 1999-2021 by the D Language Foundation