Bug 6239 - MessageTag removes apostrophe ("'")
Summary: MessageTag removes apostrophe ("'")
Alias: None
Product: Taglibs
Classification: Unclassified
Component: I18N Taglib (show other bugs)
Version: 1.0
Hardware: HP other
: P3 blocker (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-02-05 09:13 UTC by Yop
Modified: 2004-11-16 19:05 UTC (History)
0 users

Change to documentation to make this behaviour clear (1001 bytes, patch)
2002-12-09 15:32 UTC, Jon Evans
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yop 2002-02-05 09:13:40 UTC
The i18n taglibs doesn't seem to work properly with some languages.
In fact, the MessageTag removes all apostrophes("'"). 

Code 1 :
java.util.Locale locale = new java.util.Locale("fr", "CH");
<i18n:bundle baseName="org.apache.taglibs.i18n.Bookmark"
             locale="<%= locale%>"/>
<i18n:message key="BodyText1" bundle="<%=text_bundle%>"/>

It writes : "Vous trouverez dautres informations sur le sujet à "

Code 2:
ResourceBundle rb = ResourceBundle.getBundle
("org.apache.taglibs.i18n.Bookmark", new java.util.Locale("fr", "CH"));

It writes : "Vous trouverez d'autres informations sur le sujet à "

Any idea?
Comment 1 Trevor Dunn 2002-03-25 15:58:49 UTC
I found this also, but it is not a bug.  It is function of the 
java.util.MessageFormatter used in the tag.  The MessageFormatter requires all 
single quotes to be escaped by a single quote to show up.  Therefore to show 
the single quote you need '' in your message.  I did this and everything worked 

Comment 2 Jon Evans 2002-12-09 15:32:03 UTC
Created attachment 4080 [details]
Change to documentation to make this behaviour clear
Comment 3 Jon Evans 2002-12-09 15:32:53 UTC
I have created a patch to the documentation web page, to make this clear.
Comment 4 Glenn Nielsen 2002-12-17 02:24:14 UTC
Updated docs for the messageArg tag, also made sure that the MessageFormat
was only used when there really were arguments.  It was being used in all
cases.  Bug fix should be available in next nightly build.