std.net.curl get webpage asia font issue

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Jun 8 03:50:18 PDT 2012


On 08.06.2012 5:03, Sam Hu wrote:
> On Thursday, 7 June 2012 at 10:43:32 UTC, Dmitry Olshansky wrote:
>>> string content = get("dlang.org");
>>
>> It's simple this line you "convert" whatever site content was to
>> unicode. Problem is that "convert" is either broken or it's simply a
>> cast whereas it should re-encode source as unicode. So the way around
>> is to get it to array of bytes and decode yourself.
>>
>
> Thanks.May I know how ?Appreciated a piece of code segment.

seems like
ubyte[] data = get!(AutoProtocol, ubyte)("your-site.cn");
//should work, sorry I'm on windows and curl doesn't work here for me
then you work with your data, decode and whatever, at least this:
writeln(data);//will not throw but will print bytes

-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list