28 |
#include "wptErrors.h" |
#include "wptErrors.h" |
29 |
#include "wptTypes.h" |
#include "wptTypes.h" |
30 |
#include "wptW32API.h" |
#include "wptW32API.h" |
31 |
|
#include "wptUTF8.h" |
32 |
|
|
33 |
void progress_callback (void *opaque, const char *what, int type, |
void progress_callback (void *opaque, const char *what, int type, |
34 |
int off, int max); |
int off, int max); |
51 |
return -1; |
return -1; |
52 |
} |
} |
53 |
|
|
54 |
|
|
55 |
|
/* UTF8 klude: Remove byte order marker */ |
56 |
|
if (nread > 3 && cb->off == 0 && !memcmp(buffer, UTF8_BOM, 3)) { |
57 |
|
BYTE *buf = (BYTE*)buffer; |
58 |
|
memmove(buf, buf + 3, nread - 3); |
59 |
|
nread -= 3; |
60 |
|
} |
61 |
|
|
62 |
/* XXX: there is a sync problem with the progress dialog. */ |
/* XXX: there is a sync problem with the progress dialog. */ |
63 |
if (pfx != NULL) |
if (pfx != NULL) |
64 |
progress_callback (pfx, NULL, 0, cb->off, cb->size); |
progress_callback (pfx, NULL, 0, cb->off, cb->size); |