Return-Path: Delivered-To: apmail-maven-doxia-dev-archive@www.apache.org Received: (qmail 96548 invoked from network); 7 Nov 2008 12:45:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2008 12:45:31 -0000 Received: (qmail 67933 invoked by uid 500); 7 Nov 2008 12:45:38 -0000 Delivered-To: apmail-maven-doxia-dev-archive@maven.apache.org Received: (qmail 67912 invoked by uid 500); 7 Nov 2008 12:45:38 -0000 Mailing-List: contact doxia-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: doxia-dev@maven.apache.org Delivered-To: mailing list doxia-dev@maven.apache.org Received: (qmail 67901 invoked by uid 99); 7 Nov 2008 12:45:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 04:45:38 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.27.42.64] (HELO smtp7-g19.free.fr) (212.27.42.64) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 12:44:20 +0000 Received: from smtp7-g19.free.fr (localhost [127.0.0.1]) by smtp7-g19.free.fr (Postfix) with ESMTP id 6F0FBB0180 for ; Fri, 7 Nov 2008 13:45:01 +0100 (CET) Received: from dell-desktop.local (put92-4-82-231-48-193.fbx.proxad.net [82.231.48.193]) by smtp7-g19.free.fr (Postfix) with ESMTP id 463EDB014F for ; Fri, 7 Nov 2008 13:45:01 +0100 (CET) From: =?iso-8859-1?q?Herv=E9_BOUTEMY?= To: doxia-dev@maven.apache.org Subject: (output) encoding support in doxia-sink-api Date: Fri, 7 Nov 2008 13:45:00 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811071345.00920.herve.boutemy@free.fr> X-Virus-Checked: Checked by ClamAV on apache.org Hi folks, =46or the next 1.0-beta-1 version, 2 methods have been added to SinkFactory= =20 interface to improve encoding support: =2D Sink createSink( File outputDir, String outputName, String encoding ) =2D Sink createSink( Writer writer ) See [1] for the full interface. I worked with Vincent to implement output encoding in Doxia, and we faced=20 problems that lead us think that forcing a fixed encoding was the right=20 approach to have something simple and reliable: with UTF-8 as this fixed=20 encoding, this didn't limit end-users from any country in the world. But now, I'm convinced it's not the right approach and API: 1. some formats need to output the encoding (like HTML, or XML): we need an= =20 encoding parameter, as we can't get it from a Writer instance 2. some formats embed images, like RTF or PDF, then need direct stream acce= ss=20 to write binary data Then I think "Sink createSink( Writer writer )" should be removed. Or if we want an API without filename, this method could be transformed int= o=20 Sink createSink( OutputStream output ) + Sink createSink( OutputStream=20 output, String encoding ). Any objection or idea? Herv=E9 [1]=20 http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/mai= n/java/org/apache/maven/doxia/sink/SinkFactory.java?view=3Dmarkup