extended characterset output

anonymous anon at ymous.org
Fri Apr 8 06:13:36 UTC 2022


What's the proper way to output all characters in the extended 
character set?

```d
void main()
{
     foreach(char c; 0 .. 256)
     {
        write(isControl(c) ? '.' : c);
     }
}
```

Expected output:
```
................................ 
!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~..................................¡¢£¤¥¦§¨©ª«¬.®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
```

Actual output:
```
................................ 
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~.................................������������������������������������������������������������������������������������������������
```

Works as expected in python.

Thanks


More information about the Digitalmars-d-learn mailing list