Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jul 2006 06:53:11 +0000 (06:53 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jul 2006 06:53:11 +0000 (06:53 +0000)
commit077cb8d539c7640b98b285a88e20f8570c780c5b
tree0a7057b8a9bcf957dd207f32bfecbcac7bb73b03
parent4b2e614a61ef78b10d16d2a084fee620483242ff
    Reviewed by Darin.

        Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
        REGRESSION: KOI8-U encoding no longer supported.

        Tests:
        * http/tests/misc/BOM-override.pl
        * http/tests/misc/BOM-override-script.html
        * fast/encoding/charset-koi8-u.html
        * fast/encoding/charset-x-nextstep.html

        Restored a TEC code path for encodings that are not supported by ICU (but which currently
        passes all layout tests even by itself with ICU disabled). A lot of refactoring is
        still needed - most importantly, round-tripping encoding names via CFStringEncoding
        makes little sense now.

        * WebCore.exp:
        * bridge/mac/WebCoreTextDecoder.h: Removed.
        * bridge/mac/WebCoreTextDecoder.mm: Removed.
        WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.

        * loader/Decoder.cpp:
        (Decoder::Decoder):
        (Decoder::setEncodingName):
        (Decoder::decode):
        Use StreamingTextDecoder::create().

        * platform/StreamingTextDecoder.cpp:
        (WebCore::StreamingTextDecoder::create):
        (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
        * platform/StreamingTextDecoder.h:
        StreamingTextDecoder is just an abstract interface to implementations now.

        * platform/StreamingTextDecoderICU.cpp: Added.
        (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
        (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
        (WebCore::StreamingTextDecoderICU::releaseICUConverter):
        (WebCore::StreamingTextDecoderICU::textEncodingSupported):
        (WebCore::StreamingTextDecoderICU::convertUTF16):
        (WebCore::StreamingTextDecoderICU::convertIfASCII):
        (WebCore::StreamingTextDecoderICU::createICUConverter):
        (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
        (WebCore::StreamingTextDecoderICU::convertUsingICU):
        (WebCore::StreamingTextDecoderICU::convert):
        (WebCore::StreamingTextDecoderICU::toUnicode):
        (WebCore::StreamingTextDecoderICU::fromUnicode):
        * platform/StreamingTextDecoderICU.h: Added.
        Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
        supported by the decoder; minor cleanup.

        * platform/TextEncoding.cpp:
        (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
        (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
        (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.

        * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().

        * platform/mac/StreamingTextDecoderMac.cpp: Added.
        (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
        (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
        (WebCore::StreamingTextDecoderMac::releaseTECConverter):
        (WebCore::StreamingTextDecoderMac::textEncodingSupported):
        (WebCore::StreamingTextDecoderMac::convertUTF16):
        (WebCore::StreamingTextDecoderMac::convertIfASCII):
        (WebCore::StreamingTextDecoderMac::createTECConverter):
        (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
        (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
        (WebCore::StreamingTextDecoderMac::convertUsingTEC):
        (WebCore::StreamingTextDecoderMac::convert):
        (WebCore::StreamingTextDecoderMac::toUnicode):
        (WebCore::StreamingTextDecoderMac::fromUnicode):
        * platform/mac/StreamingTextDecoderMac.h: Added.
        (WebCore::StreamingTextDecoderMac::convert):
        This is a TEC+CFString code path for decoding, basically restored from a year-old revision.

        * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.

        * WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/encoding/charset-koi8-u-expected.txt [new file with mode: 0644]
LayoutTests/fast/encoding/charset-koi8-u.html [new file with mode: 0644]
LayoutTests/fast/encoding/charset-x-nextstep-expected.txt [new file with mode: 0644]
LayoutTests/fast/encoding/charset-x-nextstep.html [new file with mode: 0644]
LayoutTests/http/tests/misc/BOM-override-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/BOM-override-script-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/BOM-override-script.html [new file with mode: 0644]
LayoutTests/http/tests/misc/BOM-override.pl [new file with mode: 0755]
LayoutTests/http/tests/misc/resources/BOM-override-2.pl [new file with mode: 0755]
LayoutTests/http/tests/misc/resources/BOM-override-3.pl [new file with mode: 0755]
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/WebCoreTextDecoder.h [deleted file]
WebCore/bridge/mac/WebCoreTextDecoder.mm [deleted file]
WebCore/loader/Decoder.cpp
WebCore/platform/StreamingTextDecoder.cpp
WebCore/platform/StreamingTextDecoder.h
WebCore/platform/StreamingTextDecoderICU.cpp [new file with mode: 0644]
WebCore/platform/StreamingTextDecoderICU.h [new file with mode: 0644]
WebCore/platform/TextEncoding.cpp
WebCore/platform/TextEncoding.h
WebCore/platform/mac/StreamingTextDecoderMac.cpp [new file with mode: 0644]
WebCore/platform/mac/StreamingTextDecoderMac.h [new file with mode: 0644]
WebCore/platform/mac/TextEncodingMac.cpp [deleted file]