On Monday, 9 December 2013 at 02:40:29 UTC, Hugo Florentino wrote:
auto input = readText("myfile.htm");

Don't use readText if it isn't utf-8; readtext assumes it is utf 8.

I've never actually used std.encoding (I wrote my own encoding module for my dom.d, which I used for website scraping too) but I think this is what you want:

Latin1String input = cast(Latin1String) std.file.read("myfile.htm");
string buffer;
transcode(input, buffer);
auto output = replace(buffer, re1, re2);


see if that works

Reply via email to