[greenstone-users] Re: Oaiserver, demo collection, special caracters and accents

From Katherine Don
DateMon, 17 Oct 2005 15:03:42 +1300
Subject [greenstone-users] Re: Oaiserver, demo collection, special caracters and accents
In-Reply-To (5-0-2-1-2-20051007110650-00bdd0d0-pop-doc-bondy-ird-fr)
Hi Pier

Hmmm, it looks like we are not outputting UTF8, even though we say we
are :-(

I'll try to fix this up properly, but for now, if you are able to
compile the code, you can make a simple change to get your metadata
output in UTF-8.

In gsdl/src/recpt/oaiservr, edit the file metaformat.cpp

Change the output_item method to the following:

void metaformat::output_item(ostream &output, bool &headerDone, const
text_t &label,
const text_tarray &values)
{
utf8outconvertclass utf8convert;

if (!headerDone && (values.size() > 0)) {
this->output_metadata_header(output);
headerDone = true;
}

for (int item = 0; item < values.size(); ++item) {
if (this->oaiConfigure->getOAIVersion() >= 200) { // TODO: GRB: This
code may need to be subclassed by dc for 200 and later...
output << utf8convert << " <" << this->formatPrefix() <<
":" << label << ">" << values[item] << "</" << this->formatPrefix() <<
":" << label << "> ";
}
else {
output << utf8convert << " <" << label << ">" <<
values[item] << "</" << label << "> ";
}
}
}

The changes are declaring a utf8outconvertclass, then adding
"<< utf8convert " in both the output statements.

Then compile the code.
Please let me know if you do this - does it fix your problems?

Regards,
Katherine


Pier.Luigi.Rossi@bondy.ird.fr wrote:
> Hi Greenstone,
>
> I continue to test oaiserver in greenstone.
> I start to use oia vers and arguments and i can use oai-e collection and
> see metadata
> http://localhost/gsdl/cgi-bin/oaiserver.exe?verb=ListRecords&set=oai-e&metadataPrefix=oai_dc
> <http://localhost/gsdl/cgi-bin/oaiserver.exe?verb=ListRecords&set=oai-e&metadataPrefix=oai_dc>
>
> When i try the same request in demo collection the answer is :
> La page XML ne peut pas □tre affich□e Impossible d'afficher l'entr□e XML
> en utilisant la feuille de style XSL. Corrigez l'erreur, puis cliquez
> sur le bouton _Actualiser_ ou r□essayez ult□rieurement. Un caract□re
> incorrect a □t□ trouv□ dans un contenu de texte. Erreur de traitement de
> la ressource http://localhost/gsdl/cg... <dc:Title>The Courier - N
>
> It because in the title there is this caracter : □
> I have the same with accents .....
> How can I translete or communicate this kind of caracters to oai request ?
>
> Regards
>
> P.L. Rossi
>
> IRD
> France