You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/08/01 20:14:21 UTC

DO NOT REPLY [Bug 22063] New: - Wrong encoding with redirect:write in xsltc

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22063>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22063

Wrong encoding with redirect:write in xsltc

           Summary: Wrong encoding with redirect:write in xsltc
           Product: XalanJ2
           Version: CurrentCVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: fackel@dosco.de


When using redirect:write with translets made by XSLTC (Xalan-J 2.5.1) the
output is in the wrong encoding. Instead of the encoding specified in the
xslt:output element the output is in the default OS encoding. The following
patch should fix the problem (class
org.apache.xalan.xsltc.runtime.AbstractTranslet):

68c68,76
< import java.io.FileWriter;
---
> import java.io.File;
> import java.io.FileOutputStream;
> import java.io.OutputStream;
> 
> import java.io.Writer;
> import java.io.OutputStreamWriter;
> import java.io.BufferedWriter;
> import java.io.FileOutputStream;
> 
486c494,495
< 	    factory.setWriter(new FileWriter(filename, append));
---
> 	    FileOutputStream fs = new FileOutputStream (filename, append);
> 	    factory.setWriter(new BufferedWriter(new OutputStreamWriter(fs, _encoding)));