[webkit-dev] 回复: maybe it's a problem in function"addToTextEncodingNameMap" in "webcore/platform/text/TextEncodingRegistry.cpp"

江南小白 zpd64 at qq.com
Sun Oct 24 23:48:20 PDT 2010

Thanks a lot! 
 addToTextEncodingNameMap() is called in registerExtendedEncodingNames() in TextCodecICU.cpp:
           registrar("macroman", "macintosh");
  ------------------ 原始邮件 ------------------
  发件人: "Alexey Proskuryakov"<ap at webkit.org>;
 发送时间: 2010年10月25日(星期一) 中午1:38
 收件人: "江南小白"<zpd64 at qq.com>; 
 抄送: "webkit-dev"<webkit-dev at lists.webkit.org>; 
 主题: Re: [webkit-dev] maybe it's a problem in function"addToTextEncodingNameMap" in "webcore/platform/text/TextEncodingRegistry.cpp"


  24.10.2010, в 20:31, 江南小白 написал(а):

  static void addToTextEncodingNameMap(const char* alias, const char* name)
    ASSERT(strlen(alias) <= maxEncodingNameLength);
    const char* atomicName = textEncodingNameMap->get(name);
    ASSERT(strcmp(alias, name) == 0 || atomicName);
    if (!atomicName)
        atomicName = name;
    checkExistingName(alias, atomicName);
    textEncodingNameMap->add(alias, atomicName);
       Here comes a problem when i call this function like this: addToTextEncodingNameMap("myEncodingAlias", "myEncodingName"), then the assert in red is hit, Because "myEncodingName" was not early registered in textEncodingNameMap  by funciton "buildBaseTextCodecMaps”, and "myEncodingAlias" is not equal with "myEncodingName". I think this does not make sense, maybe the assert in red should be removed?

 Where are you calling addToTextEncodingNameMap() from, and with which arguments?

 It makes no sense to register an alias for an unknown encoding, so this assertion rightfully fires.

  - WBR, Alexey Proskuryakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20101025/7da733e0/attachment.html>

More information about the webkit-dev mailing list