Ignore:
Timestamp:
Jul 30, 2007 10:08:29 AM (17 years ago)
Author:
dkearney
Message:

adjustments to entity references encoding to include the length of the string to encode and decode.
this is used for the python bindings, so we can know the length of the string being returned and allow embedded nulls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/RpLibrary.cc

    r769 r788  
    15391539    status &= Rappture::encoding::decode(inData,0);
    15401540    status.addContext("RpLibrary::getSting");
    1541     inData.append("\0",1);
     1541    // inData.append("\0",1);
    15421542
    15431543    if (translateFlag == RPLIB_TRANSLATE) {
    1544         translatedContents = ERTranslator.decode(inData.bytes());
     1544        translatedContents = ERTranslator.decode(inData.bytes(),inData.size());
    15451545        if (translatedContents == NULL) {
    15461546            // translation failed
     
    15511551        }
    15521552        else {
    1553             retStr = std::string(translatedContents);
     1553            // subtract 1 from size because ERTranslator adds extra NULL
     1554            retStr = std::string(translatedContents,ERTranslator.size()-1);
    15541555            translatedContents = NULL;
    15551556        }
    15561557    }
    15571558    else {
    1558         retStr = std::string(inData.bytes());
     1559        retStr = std::string(inData.bytes(),inData.size());
    15591560    }
    15601561
     
    17011702
    17021703    if (translateFlag == RPLIB_TRANSLATE) {
    1703         translatedContents = ERTranslator.decode(retCStr);
     1704        translatedContents = ERTranslator.decode(retCStr,0);
    17041705        if (translatedContents == NULL) {
    17051706            // translation failed
     
    17691770
    17701771        if (translateFlag == RPLIB_TRANSLATE) {
    1771             translatedContents = ERTranslator.encode(value.c_str());
     1772            translatedContents = ERTranslator.encode(value.c_str(),0);
    17721773        }
    17731774        else {
Note: See TracChangeset for help on using the changeset viewer.