An empty string in the charset tag (0008,0005) indicate the default charset, but Imebra skips empty string in 0008,0005

Issue #340 closed
Paolo Brandoli repo owner created an issue

In the following code:

            // We found the charsets list
            if(tagId == 0x0008 && tagSubId == 0x0005)
            {
                std::shared_ptr<handlers::readingDataHandler> charsetsHandler(pDataSet->getReadingDataHandler(0x0008, 0, 0x0005, 0));
                charsetsList_t charsets;
                for(size_t componentId(0); componentId != charsetsHandler->getSize(); ++componentId)
                {
                    const std::string charset(charsetsHandler->getString(componentId));
                    if(!charset.empty())
                    {
                        charsets.push_back(charset);
                    }
                }
                pDataSet->setCharsetsList(charsets);
            }

replace the check for empty string with a push of the default charset.

Comments (8)

  1. Log in to comment