print non-ASCII/UTF-8 string

BCS BCS at pathilink.com
Fri Dec 22 11:38:26 PST 2006


Thomas Kuehne wrote:
> -----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

This works as well. But only because array parts are in the correct 
order to begin with

printf("%.*s\n", l);



More information about the Digitalmars-d mailing list