print non-ASCII/UTF-8 string
Thomas Kuehne
thomas-dloop at kuehne.cn
Fri Dec 22 11:18:00 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jarrett Billingsley schrieb am 2006-12-22:
> "Egor Starostin" <egorst at gmail.com> wrote in message
> news:emgvkj$1ll6$1 at digitaldaemon.com...
>
>> I don't need to convert to UTF-8. I just need to raw print exactly the
>> same string
>> as in original file.
>
> Hm. This might be one case where printf is actually useful:
>
> foreach(l; f)
> printf("%s\n", toStringz(l));
This should work more reliable and consume less resources:
printf("%.*s\n", l.length, l.ptr);
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFjDDwLK5blCcjpWoRAkg4AJ4uUr0r5t6p2DSD0WYoQU16KqjrmQCfTWjN
o4ASI5v294bKKaW1rzDPk54=
=/ey0
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list