You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Illarramendi Amilibia, Aitor" <ai...@indra.es> on 2001/11/28 12:27:16 UTC

How to use another encoding with XalanC instead of UTF-8

Hello eveybody:
 
    I'm newbie on Xerces-C and Xalan-C developing.
 
    I'm just doing a simple application, like SimpleTransform sample from
Xalan's samples.
 
        The code is merely like that:
 
            XalanTransformer::initialize();
            XMLPlatformUtils::Initialize();
 
            const char* inFile = "foo.xml"; // With xsl stylesheet included
inside
            const char* outFile = "output.html";
 
            XalanTransformer transformer;
 
            int result = transformer.transform(inFile,outFile);    
 
            XalanTransformer::terminate();
            XMLPlatformUtils::Terminate();
 
    I try to use XalanTransformer object to transform a XML with XSL
stylesheet to a HTML output.
    
    XML and XSL files have ISO-8859-1 encoding, and have special symbols
like: º, ´, etc.
 
    When I transform this XML with the XSL via Xalan-C and Xerces-C, I
achieve an .html file, well formed, but with all this symbols corrupted like
º instead of º, etc.
 
    When I see the encoding of the resultant output file I can see that the
encoding passed to the file, I supose that it's done by Xalan or Xerces, is
UTF-8.
 
    Yet, I don't use ICU, if I install ICU and rebuild Xalan (may I rebuild
Xerces-C too? If so, how?), it would work?
 
    I have to use some other XalanC classes?
 
    Please help a newbie.
 
Thanks for advance.
 
	Aitor Illarramendi Amilibia	
 	 
Ingeniero de software
Detección, Mando y Control 
 <http://www.indra.es/>  Indra.bmp	
 	 
Carretera de Loeches, 9
28850 - Torrejón de Ardoz, Madrid (ESPAÑA)
Tel: +34-91-396.82.47
Fax: +34-91-396.81.14
aillarramendi@indra.es <ma...@indra.es> 
www.indra.es <http://www.indra.es/>