Wow!
I've looked all over the place for something documenting the encoding used
by
Property Resource Bundles. Can you tell me where in the JavaDocs the
clipping you sent me is from? Thanks very much! (I'd seen in the source
code that the JDK implementation assumed ISO-8859-1 was used for
Property Resource Bundles, but I couldn't find any documentation saying that
this was the case.)
Is the 'native2ascii' tool a UNIX item, does it come with Java, or is it
downloadable
somewhere?
And you are right regarding the ListResourceBundle classes. In an
emergency, they
can certainly be deployed simply by adding them to the classpath. However,
from
a general deployment perspective, the handover to operations should contain
something
neat that can be deployed as a unit (one of the big reasons behind the jar,
and now the
war files I'm sure). Changing such units in order to add a new class may
not work
neatly if the file is in user due to a running server requiring access.
Thanks again,
-AMT
> -----Original Message-----
> From: Vyacheslav Pedak [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 10, 2000 8:59 PM
> To: Arun Thomas
> Subject: Re: Re: localization
>
>
> OK, if you want to work with text files (PropertyResourceBundle)
> you should deal with system properties, so see jdk documentation:
>
> "When saving properties to a stream or loading them from a stream, the ISO
> 8859-1 character
> encoding is used. For characters that cannot be directly
> represented in this
> encoding, Unicode escapes
> are used; however, only a single 'u' character is allowed in an escape
> sequence. The native2ascii tool
> can be used to convert property files to and from other character
> encodings."
>
> Also you do not need to recompile all project while use
> ListResourceBundles,
> you only need to put your ListResourceBundle class to classpath.
>
> Vyacheslav Pedak
>
>
> ----- Original Message -----
> From: Arun Thomas <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 11, 2000 9:47 AM
> Subject: Re: localization
>
>
> > Vyacheslav,
> >
> > You're right that I could use ListResourceBundles, but, one of the
> > advantages of
> > using property resource bundles when the only items to be localized are
> > string
> > is that the property files can be handed over to a translator or someone
> > with no
> > idea how code should look, and a translated version can be
> provided in the
> > appropriate language, As soon as you have code elements, the potential
> for
> > confusion on their part, and errors in the translated copy, increases.
> >
> > Another major advantage is that adding a property resource
> bundle is quite
> > easy
> > - it means adding a text file, no compilation necessary. This can
> actually
> > be
> > done at run-time, allowing dynamic addition of support for a
> new language
> > without any system downtime. Adding a class, however, can be much more
> > complicated, as most class-files are released within jars, etc which
> cannot
> > be
> > erased/modified while in use by most servers.
> >
> > As for specifying the locale, well, the locale is only used to
> the extent
> > that
> > the name of the ResourceBundle to be instantiated is specified by the
> > locale.
> > The actual contents of the bundle are loaded completely independently of
> > locale.
> > With respect to Property Resource Bundles in particular, notice that
> Locale
> > objects do not provide any means to derive a valid text
> encoding - this is
> > reasonable
> > as there are multiple encodings which can effectively encode the
> characters
> > from any specific Locale.
> >
> > Thanks for the input though....
> > -AMT
> >
> > > -----Original Message-----
> > > From: Vyacheslav Pedak [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, April 10, 2000 6:53 PM
> > > To: Arun Thomas
> > > Subject: Re: Re: localization
> > >
> > >
> > > Hi
> > >
> > > You do not need to know encoding to work with ResourceBundles,
> > > because you may use ListResourceBundle (this is java class, so
> > > you characters will be in unicode).
> > > To work with ResourceBundles you need to specify locale or
> > > use default locale from JVM. (see java.util.Locale class).
> > > The default system locale is established by JVM from your
> > > environment.
> > >
> > > Vyacheslav Pedak
> > >
> > > ----- Original Message -----
> > > From: Arun Thomas <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, April 11, 2000 4:19 AM
> > > Subject: Re: localization
> > >
> > >
> > > > Govind,
> > > >
> > > > I'm hoping you can help clarify a point about localization that
> > > I've been
> > > > able
> > > > to find little comment about.... In the last few lines of your
> > > JavaWorld
> > > > article,
> > > > you write:
> > > >
> > > > If you are using something other than the
> ISO-8859-1 character
> > > set, you
> > > > must communicate this to the browser using the contentType
> > > attribute of
> > > > the page tag, as:
> > > > <%@ page contentType="text/html; charset=charset_name" %>
> > > >
> > > > You follow on to explain the compliancy requirements of the browser.
> > > >
> > > > My question deals with the JSP engine (and ResourceBundles for that
> > > matter).
> > > > How do these objects know the encoding used to store the JSP Page or
> > > > Property file? In order to read in these items for parsing into JSP
> > > > Servlets/
> > > > ResourceBundles, some particular encoding must be used. I can't
> > > understand
> > > > how
> > > > the engine could possible determine the encoding to use for a
> particular
> > > > file
> > > > based on information stored within the file (the @page directive
> above).
> > > In
> > > > the case of ResourceBundles, as far as I can see, the
> getBundle method
> > > must
> > > > be
> > > > assuming a particular encoding for the Property files, as
> none of the
> > > > various
> > > > method signatures provide any means to specify the encoding to use.
> > > >
> > > > Any clarification would be greatly appreciated.
> > > >
> > > > Thanks for a good article.
> > > > -AMT
> > > >
> > >
> > >
> > >
> >
> >
> ==================================================================
> =========
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets