{"record":{"id":"96d04f712003ce62","repo":"nodejs/node","slug":"u-unsupported-error-96d04f","errorCode":"U_UNSUPPORTED_ERROR","errorMessage":"icupkg: data format %02x.%02x.%02x.%02x (format version %02x) is not recognized as an ICU .dat package\\n","messagePattern":"icupkg: data format %02x\\.%02x\\.%02x\\.%02x \\(format version %02x\\) is not recognized as an ICU \\.dat package\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/package.cpp","lineNumber":497,"sourceCode":"    headerLength=sizeof(header);\n    if(length<headerLength) {\n        headerLength=length;\n    }\n    headerLength=udata_swapDataHeader(ds, inData, headerLength, header, &errorCode);\n    if(U_FAILURE(errorCode)) {\n        exit(errorCode);\n    }\n\n    /* check data format and format version */\n    pInfo = reinterpret_cast<const UDataInfo*>(reinterpret_cast<const char*>(inData) + 4);\n    if(!(\n        pInfo->dataFormat[0]==0x43 &&   /* dataFormat=\"CmnD\" */\n        pInfo->dataFormat[1]==0x6d &&\n        pInfo->dataFormat[2]==0x6e &&\n        pInfo->dataFormat[3]==0x44 &&\n        pInfo->formatVersion[0]==1\n    )) {\n        fprintf(stderr, \"icupkg: data format %02x.%02x.%02x.%02x (format version %02x) is not recognized as an ICU .dat package\\n\",\n                pInfo->dataFormat[0], pInfo->dataFormat[1],\n                pInfo->dataFormat[2], pInfo->dataFormat[3],\n                pInfo->formatVersion[0]);\n        exit(U_UNSUPPORTED_ERROR);\n    }\n    inIsBigEndian = static_cast<UBool>(pInfo->isBigEndian);\n    inCharset=pInfo->charsetFamily;\n\n    inBytes=(const uint8_t *)inData+headerLength;\n    inEntries = reinterpret_cast<const UDataOffsetTOCEntry*>(inBytes + 4);\n\n    /* check that the itemCount fits, then the ToC table, then at least the header of the last item */\n    length-=headerLength;\n    if(length<4) {\n        /* itemCount does not fit */\n        offset=0x7fffffff;\n    } else {\n        itemCount = udata_readInt32(ds, *reinterpret_cast<const int32_t*>(inBytes));","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/package.cpp#L479-L515","documentation":"Thrown by Package::readPackage() when the UDataInfo header's dataFormat field does not match the expected 'CmnD' (0x43, 0x6d, 0x6e, 0x44) signature with formatVersion[0]==1. This is the specific .dat package format identifier. Any other 4-byte format tag or version number means the file is not a recognized ICU .dat package.","triggerScenarios":"The data header passed the initial getTypeEnumForInputData() check in readFile() (it has a valid generic ICU data header) but when readPackage() inspects the specific dataFormat field, it is not 'CmnD' version 1. This distinguishes a .dat package from other ICU data files (e.g. individual .res files, .cnv files).","commonSituations":"Passing an individual ICU resource file (.res), a conversion table (.cnv), or other ICU data to icupkg when it expects a .dat package; a .dat file from a much older or newer ICU version that uses a different format version; a .dat file that was post-processed or re-encoded, corrupting the format tag.","solutions":["Ensure the input file is a .dat package, not an individual ICU data item.","Verify the ICU version: icupkg version should match the version that created the .dat file.","Inspect the header bytes: hexdump -C <file> | head -3 and check for 'CmnD' at the dataFormat offset.","Rebuild the .dat package with the correct icupkg version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check for 'CmnD' data format tag in the .dat file header\n#include <fstream>\n#include <cstring>\nbool isDatPackage(const char* filename) {\n    std::ifstream f(filename, std::ios::binary);\n    if (!f) return false;\n    char buf[64];\n    f.read(buf, sizeof(buf));\n    if (f.gcount() < 24) return false;\n    // UDataInfo.dataFormat is at offset: sizeof(headerMagic) + headerSize fields\n    // Look for 'CmnD' = {0x43, 0x6d, 0x6e, 0x44} in the data\n    return memmem(buf, f.gcount(), \"CmnD\", 4) != nullptr;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the input is a .dat package, not an individual .res or .cnv file.","Match the icupkg tool version to the ICU version that built the data.","Inspect the header with hexdump if format errors recur."],"tags":["icu","icupkg","data-format","version-mismatch","unsupported","corrupt-file"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}