diff options
Diffstat (limited to 'WebCore/loader/appcache/ManifestParser.cpp')
-rw-r--r-- | WebCore/loader/appcache/ManifestParser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/WebCore/loader/appcache/ManifestParser.cpp b/WebCore/loader/appcache/ManifestParser.cpp index a83303a..4169313 100644 --- a/WebCore/loader/appcache/ManifestParser.cpp +++ b/WebCore/loader/appcache/ManifestParser.cpp @@ -30,7 +30,7 @@ #include "CharacterNames.h" #include "KURL.h" -#include "TextEncoding.h" +#include "TextResourceDecoder.h" using namespace std; @@ -45,9 +45,12 @@ bool parseManifest(const KURL& manifestURL, const char* data, int length, Manife ASSERT(manifest.fallbackURLs.isEmpty()); Mode mode = Explicit; - String s = UTF8Encoding().decode(data, length); + + RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/cache-manifest", "UTF-8"); + String s = decoder->decode(data, length); + s += decoder->flush(); - // Look for the magic signature: "^\xFEFF?CACHE MANIFEST[ \t]?" (the BOM is removed by decode()). + // Look for the magic signature: "^\xFEFF?CACHE MANIFEST[ \t]?" (the BOM is removed by TextResourceDecoder). // Example: "CACHE MANIFEST #comment" is a valid signature. // Example: "CACHE MANIFEST;V2" is not. if (!s.startsWith("CACHE MANIFEST")) |