xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Börkel ...@ap-ag.com>
Subject RE: Transformer uses correct encoding, but does not write UTF-8 marker intofile
Date Tue, 08 Oct 2002 09:03:52 GMT
HI!

It's Notepad from Windows 2000.

Regards,
Thomas

> -----Original Message-----
> From: David N Bertoni/Cambridge/IBM 
> [mailto:david_n_bertoni@us.ibm.com] 
> Sent: Dienstag, 24. September 2002 17:45
> To: xalan-j-users@xml.apache.org
> Subject: Re: Transformer uses correct encoding, but does not 
> write UTF-8 marker intofile
> 
> 
> 
> 
> 
> 
> 
> There is no real need for a UTF-8 BOM, so most XML processing 
> systems don't
> write one.  What software are you using that requires one?
> 
> Dave
> 
> 
> 
>                                                               
>                                                               
>            
>                       Thomas Börkel                           
>                                                               
>            
>                       <tb@ap-ag.com>           To:      
> "Xalan Mailinglist" <xalan-j-users@xml.apache.org>            
>                  
>                                                cc:      (bcc: 
> David N Bertoni/Cambridge/IBM)                                
>            
>                       09/24/2002 01:18         Subject: 
> Transformer uses correct encoding, but does not write UTF-8 
> marker into file   
>                       AM                                      
>                                                               
>            
>                                                               
>                                                               
>            
>                                                               
>                                                               
>            
> 
> 
> 
> HI!
> 
> I am writing an XML DOM to a file, using UTF-8 encoding. The 
> encoding is
> OK, the XML declaration is there, but the leading UTF-8 
> markers are missing
> in the file. Is this a bug or how can this be achieved? Thanks!
> 
> This is the code:
> 
>     TransformerFactory tFactory;
>     Transformer transformer;
>     StreamResult streamResult;
> 
>     tFactory = TransformerFactory.newInstance();
>     transformer = tFactory.newTransformer();
>     transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
>     streamResult = new StreamResult(file);
>     transformer.transform(new DOMSource(node), streamResult);
> 
> 
> Regards,
> Thomas
> 
> 
> 
> 
> 

Mime
View raw message