Thread overview | ||||||
---|---|---|---|---|---|---|
|
February 24, 2020 How make wsatring or dstring default for string and literals? | ||||
---|---|---|---|---|
| ||||
I live in Brazil and speak português brasileiro and need make programs that is good with words like ã, á, ç, ê, etc. How can I make wstring or dstring default for string and literals? I don't want to explicit this every time. |
February 24, 2020 Re: How make wsatring or dstring default for string and literals? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcone | On Monday, 24 February 2020 at 19:27:04 UTC, Marcone wrote:
> I live in Brazil and speak português brasileiro and need make programs that is good with words like ã, á, ç, ê, etc.
Regular string works with those just fine too.
|
February 24, 2020 Re: How make wsatring or dstring default for string and literals? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Monday, 24 February 2020 at 19:28:43 UTC, Adam D. Ruppe wrote:
> On Monday, 24 February 2020 at 19:27:04 UTC, Marcone wrote:
>> I live in Brazil and speak português brasileiro and need make programs that is good with words like ã, á, ç, ê, etc.
>
> Regular string works with those just fine too.
foreach(i; "Canção")
{
writeln(i);
}
Prints:
C
a
n
�
�
�
�
o
|
February 24, 2020 Re: How make wsatring or dstring default for string and literals? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcone | On Monday, 24 February 2020 at 21:25:50 UTC, Marcone wrote:
> foreach(i; "Canção")
> Prints:
Try
foreach(dchar i; "Canção") // note the added dchar
to see a different presentation of the very same data.
If you take the strings apart byte by byte that will look different, but they all represent the same characters, and foreach can help decode that if you ask it to.
|
Copyright © 1999-2021 by the D Language Foundation