> On Friday 11 February 2005 17:45, Shinobu Kawai
> wrote:
> > It's all Java stuff.  Java stores data in memory
> as Unicode, so
> > everything going into Java must be converted into
> Unicode.  Currently,
> > there is no way Java can tell whether a file is
> ascii or Greek or
> > Japanese or whatever.  So, you have to Unicode
> escape the files.
> > native2ascii makes life a bit easier.  ;)
> 
> Ok this is true, and maybe we are getting a bit out
> of topic but, why cant I 
> just save the file in UTF-8 format? Isn't that
> unicode? :/
> 
> Also, while searching for a solution I came across
> the load(InputStream) 
> method of java.util.Properties which has the value
> of charset hardcoded to 
> "8859_1" which made me wonder...

See my webpage and about UnicodeFileResourceLoader
extension.
http://koti.mbnet.fi/akini/java/unicodereader/

My loader handles properly UTF-8 BOM marker, which you
will get if use windows Notepad. Bom marker is a good
thing, but current java readers cannot handle it
properly (but do handle fine UTF-16 bom markers).

Java default uses ISO-8859-1 as an encoding if one is
not explicitly given. It is a source of various
problems in internationalization issues.

I always save all java .properties files as UTF-8 file
and load them with java.io.StreamInputStream instance
or my UnicodeInputStream/Reader utility classes.

If you generate web pages, _always_ assign
response.setContentType("text/html; charset=UTF-8") to
make life easier at browser side.


                
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to