You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2009/09/05 14:46:15 UTC
svn commit: r811631 -
/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Author: vsiveton
Date: Sat Sep 5 12:46:15 2009
New Revision: 811631
URL: http://svn.apache.org/viewvc?rev=811631&view=rev
Log:
o workaround to take care of quote (see MPIR-136)
Modified:
maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=811631&r1=811630&r2=811631&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Sat Sep 5 12:46:15 2009
@@ -1741,7 +1741,7 @@
// ----------------------------------------------------------------------
/**
- * A sink to generate Maven report as xdoc.
+ * A sink to generate a Maven report as xdoc with some known workarounds.
*
* @since 1.1
*/
@@ -1761,6 +1761,13 @@
// workaround to fix reporting-impl issue, no call of tableRows( justification, grid )
writeStartTag( HtmlMarkup.TABLE );
}
+
+ /** {@inheritDoc} */
+ public void text( String text )
+ {
+ // workaround to fix quotes (MPIR-136)
+ super.write( StringUtils.replace( text, "\u0092", "'" ) );
+ }
}
/**
Re: svn commit: r811631 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Posted by Hervé BOUTEMY <he...@free.fr>.
Le lundi 07 septembre 2009, Lukas Theussl a écrit :
> > - it works nicely with 2.1.2+
>
> So in other words, r811631 is not needed anymore, just use pir 2.1.2 and
> everything is fine, or is there some downside?
I don't know any downside
Regards,
Hervé
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r811631 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Posted by Lukas Theussl <lt...@apache.org>.
Hervé BOUTEMY wrote:
> Le lundi 07 septembre 2009, Lukas Theussl a écrit :
>> Hi Guys,
>>
>> Just some remarks:
>>
>> \u0092 is not a valid xhtml character entity reference [1] (ie it is not
>> defined by the xhtml 1.0 DTD),
> not really.
> \u0092 has no named character entity, but it can be represented as a numeric
> character reference [2]
>
>> so IMO MPIR should not use it in the first
>> place.
> when it was done in MPIR-59, it worked well with HTML output. At that time, we
> considered it as a great workaround :)
>
>> I think that \u0027 (apos) should be used instead but MPIR-136
>> states that this leads to test failures?
> Yes, simple quote caused a problem with maven-reporting-impl 2.0.4.1.
> I just renamed the issue from MNG-2855 to MSHARED-130 to better track the
> issue (fixed in 2.0.4.2)
>
>> I'd guess that this should be
>> fixed instead?
> Yes, it was fixed in maven-project-info-report-plugin 2.1.2 MPIR-136: there is
> not more Unicode \u0092 hack, simple quote doesn't break the french locale
> report
>
> Then for people wanting to use french locale of maven-project-info-report-
> plugin:
> - it simply doesn't work with 2.0.1
> - it works for HTML site with 2.1 and 2.1.1, but cause a problem with pdf
> (quote rendered as #)
> - it works nicely with 2.1.2+
So in other words, r811631 is not needed anymore, just use pir 2.1.2 and
everything is fine, or is there some downside?
>
>> In any case, I also don't like it if we arbitrarily re-write some
>> characters just to work around a bug elsewhere. If a user wants to use this
>> entity (ie declares it in an external DTD and gets the right font), then he
>> may very well complain if it gets replaced by a 'too clever' pdf plugin.
> +1 totally agree
>
>> Finally, in case you are not aware, there is a test document in the pdf
>> plugin to render all xhtml entities, check the file
>> target/test-output/pdf/unnamed.pdf. As you see there are a few characters
>> rendered as # (specifically for me: U+2032, U+2033, U+203E, U+2308, U+2309,
>> U+230A, U+230B, 7 out of 253). I always attributed that to missing fonts
>> but maybe it's actually a fop issue..
> I must admit I tried to find where the problem lies (to submit a patch to FOP
> if necessary) but was not able to really understand. Giving up...
Me too... :( I just found out that U+2032, U+2033 render with the Symbol font but
there are a couple of characters I couldn't get to display with any font: zwnj
(0x200C), zwj (0x200D), lrm (0x200E), rlm (0x200F), oline (0x203E), lceil
(0x2038), rceil (0x2039), lfloor (0x203A), rfloor (0x203B). I don't think they are
used very frequently...
-Lukas
>
> Regards,
>
> Hervé
>
>> Cheers,
>> -Lukas
>>
>> [1]
>> http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_referenc
>> es
>
> [2] http://en.wikipedia.org/wiki/Unicode_and_HTML
>
>> Vincent Siveton wrote:
>>> Hi Hervé,
>>>
>>> 2009/9/5 Hervé BOUTEMY <he...@free.fr>:
>>>> I'm not convinced this is a good idea: MPIR is fixed now, but this hack
>>>> will prevent anybody to output \u0092 when it is the real character they
>>>> want.
>>> Using \u0092 char will be displayed as # in the pdf so I don't think
>>> user want to use this char.
>>>
>>> MPIR 2.1.x uses \u0092 instead of quote due to an old hack MPIR-59 so
>>> IMHO we need to add this workaround to correctly generate PDF in
>>> French.
>>>
>>> Cheers,
>>>
>>> Vincent
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r811631 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Posted by Hervé BOUTEMY <he...@free.fr>.
Le lundi 07 septembre 2009, Lukas Theussl a écrit :
> Hi Guys,
>
> Just some remarks:
>
> \u0092 is not a valid xhtml character entity reference [1] (ie it is not
> defined by the xhtml 1.0 DTD),
not really.
\u0092 has no named character entity, but it can be represented as a numeric
character reference [2]
> so IMO MPIR should not use it in the first
> place.
when it was done in MPIR-59, it worked well with HTML output. At that time, we
considered it as a great workaround :)
> I think that \u0027 (apos) should be used instead but MPIR-136
> states that this leads to test failures?
Yes, simple quote caused a problem with maven-reporting-impl 2.0.4.1.
I just renamed the issue from MNG-2855 to MSHARED-130 to better track the
issue (fixed in 2.0.4.2)
> I'd guess that this should be
> fixed instead?
Yes, it was fixed in maven-project-info-report-plugin 2.1.2 MPIR-136: there is
not more Unicode \u0092 hack, simple quote doesn't break the french locale
report
Then for people wanting to use french locale of maven-project-info-report-
plugin:
- it simply doesn't work with 2.0.1
- it works for HTML site with 2.1 and 2.1.1, but cause a problem with pdf
(quote rendered as #)
- it works nicely with 2.1.2+
>
> In any case, I also don't like it if we arbitrarily re-write some
> characters just to work around a bug elsewhere. If a user wants to use this
> entity (ie declares it in an external DTD and gets the right font), then he
> may very well complain if it gets replaced by a 'too clever' pdf plugin.
+1 totally agree
>
> Finally, in case you are not aware, there is a test document in the pdf
> plugin to render all xhtml entities, check the file
> target/test-output/pdf/unnamed.pdf. As you see there are a few characters
> rendered as # (specifically for me: U+2032, U+2033, U+203E, U+2308, U+2309,
> U+230A, U+230B, 7 out of 253). I always attributed that to missing fonts
> but maybe it's actually a fop issue..
I must admit I tried to find where the problem lies (to submit a patch to FOP
if necessary) but was not able to really understand. Giving up...
Regards,
Hervé
>
> Cheers,
> -Lukas
>
> [1]
> http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_referenc
>es
[2] http://en.wikipedia.org/wiki/Unicode_and_HTML
>
> Vincent Siveton wrote:
> > Hi Hervé,
> >
> > 2009/9/5 Hervé BOUTEMY <he...@free.fr>:
> >> I'm not convinced this is a good idea: MPIR is fixed now, but this hack
> >> will prevent anybody to output \u0092 when it is the real character they
> >> want.
> >
> > Using \u0092 char will be displayed as # in the pdf so I don't think
> > user want to use this char.
> >
> > MPIR 2.1.x uses \u0092 instead of quote due to an old hack MPIR-59 so
> > IMHO we need to add this workaround to correctly generate PDF in
> > French.
> >
> > Cheers,
> >
> > Vincent
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r811631 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Posted by Lukas Theussl <lt...@apache.org>.
Hi Guys,
Just some remarks:
\u0092 is not a valid xhtml character entity reference [1] (ie it is not defined
by the xhtml 1.0 DTD), so IMO MPIR should not use it in the first place. I think
that \u0027 (apos) should be used instead but MPIR-136 states that this leads to
test failures? I'd guess that this should be fixed instead?
In any case, I also don't like it if we arbitrarily re-write some characters just
to work around a bug elsewhere. If a user wants to use this entity (ie declares it
in an external DTD and gets the right font), then he may very well complain if it
gets replaced by a 'too clever' pdf plugin.
Finally, in case you are not aware, there is a test document in the pdf plugin to
render all xhtml entities, check the file target/test-output/pdf/unnamed.pdf. As
you see there are a few characters rendered as # (specifically for me: U+2032,
U+2033, U+203E, U+2308, U+2309, U+230A, U+230B, 7 out of 253). I always attributed
that to missing fonts but maybe it's actually a fop issue..
Cheers,
-Lukas
[1] http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
Vincent Siveton wrote:
> Hi Hervé,
>
> 2009/9/5 Hervé BOUTEMY <he...@free.fr>:
>> I'm not convinced this is a good idea: MPIR is fixed now, but this hack will
>> prevent anybody to output \u0092 when it is the real character they want.
>
> Using \u0092 char will be displayed as # in the pdf so I don't think
> user want to use this char.
>
> MPIR 2.1.x uses \u0092 instead of quote due to an old hack MPIR-59 so
> IMHO we need to add this workaround to correctly generate PDF in
> French.
>
> Cheers,
>
> Vincent
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r811631 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Posted by Vincent Siveton <vi...@gmail.com>.
Hi Hervé,
2009/9/5 Hervé BOUTEMY <he...@free.fr>:
> I'm not convinced this is a good idea: MPIR is fixed now, but this hack will
> prevent anybody to output \u0092 when it is the real character they want.
Using \u0092 char will be displayed as # in the pdf so I don't think
user want to use this char.
MPIR 2.1.x uses \u0092 instead of quote due to an old hack MPIR-59 so
IMHO we need to add this workaround to correctly generate PDF in
French.
Cheers,
Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r811631 - /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
Posted by Hervé BOUTEMY <he...@free.fr>.
I'm not convinced this is a good idea: MPIR is fixed now, but this hack will
prevent anybody to output \u0092 when it is the real character they want.
Regards,
Hervé
Le samedi 05 septembre 2009, vsiveton@apache.org a écrit :
> Author: vsiveton
> Date: Sat Sep 5 12:46:15 2009
> New Revision: 811631
>
> URL: http://svn.apache.org/viewvc?rev=811631&view=rev
> Log:
> o workaround to take care of quote (see MPIR-136)
>
> Modified:
>
> maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins
>/pdf/PdfMojo.java
>
> Modified:
> maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins
>/pdf/PdfMojo.java URL:
> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/
>java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=811631&r1=811630&r2=81163
>1&view=diff
> ===========================================================================
>=== ---
> maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins
>/pdf/PdfMojo.java (original) +++
> maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins
>/pdf/PdfMojo.java Sat Sep 5 12:46:15 2009 @@ -1741,7 +1741,7 @@
> //
> ----------------------------------------------------------------------
>
> /**
> - * A sink to generate Maven report as xdoc.
> + * A sink to generate a Maven report as xdoc with some known
> workarounds. *
> * @since 1.1
> */
> @@ -1761,6 +1761,13 @@
> // workaround to fix reporting-impl issue, no call of
> tableRows( justification, grid ) writeStartTag( HtmlMarkup.TABLE );
> }
> +
> + /** {@inheritDoc} */
> + public void text( String text )
> + {
> + // workaround to fix quotes (MPIR-136)
> + super.write( StringUtils.replace( text, "\u0092", "'" ) );
> + }
> }
>
> /**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org