Changeset 20708 for gsdl


Ignore:
Timestamp:
2009-09-25T12:03:35+12:00 (15 years ago)
Author:
mdewsnip
Message:

Same fix as made to identifyaction.cpp, to use a utf8outconvertclass when writing output so Unicode characters are correctly encoded as UTF-8.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/oaiservr/listsetsaction.cpp

    r20629 r20708  
    151151bool listsetsaction::output_content_for_col(ostream &output, recptproto *protocol, oaiargs &params, text_t collection)
    152152{
     153  utf8outconvertclass utf8convert;
    153154  text_t position = "";
    154155
     
    184185  if (position == "" || position == collection)
    185186  {
    186     output << "  <set>" << endl;
    187     output << "    <setSpec>" << collection << "</setSpec>" << endl;
     187    output << utf8convert << "  <set>\n";
     188    output << utf8convert << "    <setSpec>" << collection << "</setSpec>\n";
    188189    if (this->configuration->getSetName(collection) != "")
    189190    {
    190       output << "    <setName>" << this->configuration->getSetName(collection) << "</setName>" << endl;
     191      output << utf8convert << "    <setName>" << this->configuration->getSetName(collection) << "</setName>\n";
    191192    }
    192193    else
    193194    {
    194       output << "    <setName>" << collection << "</setName>" << endl;
     195      output << utf8convert << "    <setName>" << collection << "</setName>\n";
    195196    }
    196197    if (this->configuration->getSetDescription(collection) != "")
    197198    {
    198       output << "    <setDescription>" << this->configuration->getSetDescription(collection) << "</setDescription>" << endl;
    199     }
    200     output << "  </set>" << endl;
     199      output << utf8convert << "    <setDescription>" << this->configuration->getSetDescription(collection) << "</setDescription>\n";
     200    }
     201    output << utf8convert << "  </set>\n";
    201202    this->setsOutput++;
    202203  }
     
    227228
    228229      // Otherwise output this set and increment the count
    229       output << "  <set>" << endl;
    230       output << "    <setSpec>" << collection << ":" << set << "</setSpec>" << endl;
     230      output << utf8convert << "  <set>\n";
     231      output << utf8convert << "    <setSpec>" << collection << ":" << set << "</setSpec>\n";
    231232      if (this->configuration->getSetName(collection + ":" + set) != "")
    232233      {
    233     output << "    <setName>" << this->configuration->getSetName(collection + ":" + set) << "</setName>" << endl;
     234    output << utf8convert << "    <setName>" << this->configuration->getSetName(collection + ":" + set) << "</setName>\n";
    234235      }
    235236      else
    236237      {
    237     output << "    <setName>" << set_response.docInfo[0].metadata["Title"].values[0] << "</setName>" << endl;
     238    output << utf8convert << "    <setName>" << set_response.docInfo[0].metadata["Title"].values[0] << "</setName>\n";
    238239      }
    239240      if (this->configuration->getSetDescription(collection + ":" + set) != "")
    240241      {
    241     output << "    <setDescription>" << this->configuration->getSetDescription(collection + ":" + set) << "</setDescription>" << endl;
    242       }
    243       output << "  </set>" << endl;
     242    output << utf8convert << "    <setDescription>" << this->configuration->getSetDescription(collection + ":" + set) << "</setDescription>\n";
     243      }
     244      output << utf8convert << "  </set>\n";
    244245      this->setsOutput++;
    245246    }
Note: See TracChangeset for help on using the changeset viewer.