Changeset 20707 for gsdl


Ignore:
Timestamp:
2009-09-25T10:31:05+12:00 (15 years ago)
Author:
mdewsnip
Message:

Now uses a utf8outconvertclass when writing output from the Identify action, so Unicode characters are correctly encoded as UTF-8.

File:
1 edited

Legend:

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

    r16711 r20707  
    5555bool identifyaction::output_content(ostream &output, recptproto *protocol, oaiargs &params)
    5656{
     57  utf8outconvertclass utf8convert;
     58
    5759  // Get the repository name (some human-readable name for the site, or superset of collections)
    5860  text_t repositoryName = this->configuration->getCollectionConfig("", "repositoryName");
     
    6365  text_t baseURL = this->configuration->getCollectionConfig("", "baseURL");
    6466 
    65   output << "  <repositoryName>"  << repositoryName << "</repositoryName>" << endl;
    66   output << "  <baseURL>"         << baseURL     << "</baseURL>" << endl; // Tack on the app name
    67   output << "  <protocolVersion>" << version        << "</protocolVersion>" << endl;
    68   output << "  <adminEmail>"      << maintainer     << "</adminEmail>" << endl;
     67  output << utf8convert << "  <repositoryName>"  << repositoryName << "</repositoryName>\n";
     68  output << utf8convert << "  <baseURL>"         << baseURL        << "</baseURL>\n";
     69  output << utf8convert << "  <protocolVersion>" << version        << "</protocolVersion>\n";
     70  output << utf8convert << "  <adminEmail>"      << maintainer     << "</adminEmail>\n";
    6971
    7072  if(version == "2.0"){
     
    7375    // not to be worth the effort of trolling through all the lastmodified dates (by others with more
    7476    // say than me)
    75     output << "  <earliestDatestamp>1970-01-01</earliestDatestamp>\n"
    76        << "  <deletedRecord>no</deletedRecord>\n"
    77       << "  <granularity>YYYY-MM-DD</granularity>\n";
     77    output << utf8convert << "  <earliestDatestamp>1970-01-01</earliestDatestamp>\n";
     78    output << utf8convert << "  <deletedRecord>no</deletedRecord>\n";
     79    output << utf8convert << "  <granularity>YYYY-MM-DD</granularity>\n";
    7880  }
    7981  // list all configuration information
     
    8183  text_tmap::iterator end  = this->configuration->getInformation()->end();
    8284  while (here != end) {
    83     output << "  <" << here->first << ">" << here->second;
    84     output << "  </" << here->first << ">" << endl;
     85    output << utf8convert << "  <" << here->first << ">" << here->second;
     86    output << utf8convert << "  </" << here->first << ">\n";
    8587    ++here;
    8688  }
Note: See TracChangeset for help on using the changeset viewer.