Changeset 69917 in webkit


Ignore:
Timestamp:
Oct 16, 2010 2:04:30 PM (13 years ago)
Author:
kseo@webkit.org
Message:

[BREWMP] Port TextCodec
https://bugs.webkit.org/show_bug.cgi?id=45797

Reviewed by Kent Tamura.

Implement TextCodec with Brew MP's ICharsetConv.
Only UTF-8 is supported for now.

  • platform/text/TextEncoding.cpp:

(WebCore::TextEncoding::encode):

  • platform/text/TextEncodingRegistry.cpp:

(WebCore::buildBaseTextCodecMaps):

  • platform/text/brew/TextCodecBrew.cpp: Added.

(WebCore::newTextCodecBrew):
(WebCore::TextCodecBrew::registerBaseEncodingNames):
(WebCore::TextCodecBrew::registerBaseCodecs):
(WebCore::TextCodecBrew::registerExtendedEncodingNames):
(WebCore::TextCodecBrew::registerExtendedCodecs):
(WebCore::TextCodecBrew::TextCodecBrew):
(WebCore::TextCodecBrew::~TextCodecBrew):
(WebCore::TextCodecBrew::decode):
(WebCore::TextCodecBrew::encode):

  • platform/text/brew/TextCodecBrew.h: Added.
Location:
trunk/WebCore
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69916 r69917  
     12010-10-16  Kwang Yul Seo  <skyul@company100.net>
     2
     3        Reviewed by Kent Tamura.
     4
     5        [BREWMP] Port TextCodec
     6        https://bugs.webkit.org/show_bug.cgi?id=45797
     7
     8        Implement TextCodec with Brew MP's ICharsetConv.
     9        Only UTF-8 is supported for now.
     10
     11        * platform/text/TextEncoding.cpp:
     12        (WebCore::TextEncoding::encode):
     13        * platform/text/TextEncodingRegistry.cpp:
     14        (WebCore::buildBaseTextCodecMaps):
     15        * platform/text/brew/TextCodecBrew.cpp: Added.
     16        (WebCore::newTextCodecBrew):
     17        (WebCore::TextCodecBrew::registerBaseEncodingNames):
     18        (WebCore::TextCodecBrew::registerBaseCodecs):
     19        (WebCore::TextCodecBrew::registerExtendedEncodingNames):
     20        (WebCore::TextCodecBrew::registerExtendedCodecs):
     21        (WebCore::TextCodecBrew::TextCodecBrew):
     22        (WebCore::TextCodecBrew::~TextCodecBrew):
     23        (WebCore::TextCodecBrew::decode):
     24        (WebCore::TextCodecBrew::encode):
     25        * platform/text/brew/TextCodecBrew.h: Added.
     26
    1272010-10-16  Patrick Gansterer  <paroga@webkit.org>
    228
  • trunk/WebCore/platform/text/TextEncoding.cpp

    r64817 r69917  
    134134    OwnPtr<TextCodec> textCodec = newTextCodec(*this);
    135135    return textCodec.get() ? textCodec->encode(characters, length, handling) : CString();
     136#elif USE(BREWMP_UNICODE)
     137    // FIXME: not sure if Brew MP normalizes the input string automatically
     138    OwnPtr<TextCodec> textCodec = newTextCodec(*this);
     139    return textCodec.get() ? textCodec->encode(characters, length, handling) : CString();
    136140#endif
    137141}
  • trunk/WebCore/platform/text/TextEncodingRegistry.cpp

    r64817 r69917  
    3232#include "TextCodecUserDefined.h"
    3333#include "TextCodecUTF16.h"
     34#include "TextEncoding.h"
    3435#include <wtf/ASCIICType.h>
    3536#include <wtf/Assertions.h>
     
    5152#if USE(GLIB_UNICODE)
    5253#include "gtk/TextCodecGtk.h"
     54#endif
     55#if USE(BREWMP_UNICODE)
     56#include "brew/TextCodecBrew.h"
    5357#endif
    5458#if OS(WINCE) && !PLATFORM(QT)
     
    236240#endif
    237241
     242#if USE(BREWMP_UNICODE)
     243    TextCodecBrew::registerBaseEncodingNames(addToTextEncodingNameMap);
     244    TextCodecBrew::registerBaseCodecs(addToTextCodecMap);
     245#endif
     246
    238247#if OS(WINCE) && !PLATFORM(QT)
    239248    TextCodecWinCE::registerBaseEncodingNames(addToTextEncodingNameMap);
Note: See TracChangeset for help on using the changeset viewer.