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

Alexey Proskuryakov ap at webkit.org
Sun Oct 24 22:38:25 PDT 2010

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/20101024/135e0094/attachment.html>

More information about the webkit-dev mailing list